64,637
社区成员
发帖
与我相关
我的任务
分享
void getrgb(LPRECT lpRect)
{
for (int x=lpRect->left; x<lpRect->right; x++)
{
for (int y=lpRect->top; y<lpRect->bottom; y++)
{
COLORREF color = GetPixel(GetDC(NULL), x, y);
printf("%X, %X, %X\n", GetRValue(color),
GetGValue(color),
GetBValue(color));
}
}
}
#define MAXY 1280
#define MAXX 1024
static BYTE R[MAXY][MAXX],G[MAXY][MAXX],B[MAXY][MAXX];
void getrgb(LPRECT lpRect)
{
for (int x=lpRect->left; x<lpRect->right; x++)
{
for (int y=lpRect->top; y<lpRect->bottom; y++)
{
COLORREF color = GetPixel(GetDC(NULL), x, y);
int Y=y-lpRect->top;
int X=x-lpRect->left;
R[Y][X]=GetRValue(color);
G[Y][X]=GetGValue(color);
B[Y][X]=GetBValue(color);
}
}
}