我想取象素的rgb值,如何娶?
请教各位大虾,我现在做关于印章提取的程序。应该怎么做?现在我想娶一个象素的rgb 值。 问题点数:100、回复次数:6Top
1 楼kingfish(工作很忙,很少来csdn...)回复于 2003-08-02 11:05:48 得分 50
GetRValue(pixel);
G
B
Top
2 楼dumei51(强自学习)回复于 2003-08-02 11:08:18 得分 0
没有这个方法!!Top
3 楼kingfish(工作很忙,很少来csdn...)回复于 2003-08-02 11:25:56 得分 0
API函数
The GetRValue macro retrieves an intensity value for the red component of a 32-bit red, green, blue (RGB) value.
BYTE GetRValue(
DWORD rgb // 32-bit RGB value
);
如:
COLORREF pixelcolor = clRed;
GetRValue(pixelcolor); //255
GetGValue(pixelcolor); //0
GetBValue(pixelcolor); //0
Top
4 楼kingfish(工作很忙,很少来csdn...)回复于 2003-08-02 11:26:47 得分 0
宏
#define GetRValue(rgb) ((BYTE) (rgb))Top
5 楼eangel9(eangel9)回复于 2003-08-02 11:42:02 得分 0
kingfish(八百里秦川@龙城异客) 说的 没错。
Top
6 楼yankcsdn(生命诚可贵)回复于 2003-08-02 16:19:49 得分 50
TColor color;
Byte bRed,bGreen,bBlue;
for(int i=0;i<bitmap->Height;i++)
for(int j=0;j<bitmap->Width;j++)
{
color=bitmap->Canvas->Pixels[i][j];
bRed=GetRValue(color);
bGreen=GetGValue(color);
bBlue=GetBValue(color);
}
Top



