Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复两个颜色相关 bug #12

Merged
merged 3 commits into from
Apr 12, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions src/egegapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ putpixels(int nPoint, int* pPoints, PIMAGE pimg) {
if ((x < 0) || (y < 0) || (x >= w) || (y >= h)) {
;
} else {
pb[y * tw + x] = RGBTOBGR(c);
pb[y * tw + x] = c;
}
}
CONVERT_IMAGE_END;
Expand All @@ -376,7 +376,7 @@ putpixels_f(int nPoint, int* pPoints, PIMAGE pimg) {
int tw = img->m_width;
for (int n=0; n<nPoint; ++n, pPoints += 3) {
c = pPoints[2];
img->m_pBuffer[pPoints[1] * tw + pPoints[0]] = RGBTOBGR(c);
img->m_pBuffer[pPoints[1] * tw + pPoints[0]] = c;
}
CONVERT_IMAGE_END;
}
Expand Down Expand Up @@ -1902,10 +1902,7 @@ clearviewport(PIMAGE pimg) {
img->m_vpt.right - img->m_vpt.left,
img->m_vpt.bottom - img->m_vpt.top
};
HBRUSH hbr_c = (HBRUSH)GetCurrentObject(img->m_hDC, OBJ_BRUSH);
LOGBRUSH logBrush;
GetObject(hbr_c, sizeof(logBrush), &logBrush);
HBRUSH hbr = CreateSolidBrush(logBrush.lbColor);
HBRUSH hbr = CreateSolidBrush(GetBkColor(img->m_hDC));
FillRect(img->m_hDC, &rect, hbr);
DeleteObject(hbr);
}
Expand Down