A ak_2005 Unregistered / Unconfirmed GUEST, unregistred user! 2005-07-23 #3 The GetPixel function retrieves the red, green, blue (RGB) color value of the pixel at the specified coordinates. COLORREF GetPixel( HDC hdc, // handle of device context int XPos, // x-coordinate of pixel int nYPos // y-coordinate of pixel );
The GetPixel function retrieves the red, green, blue (RGB) color value of the pixel at the specified coordinates. COLORREF GetPixel( HDC hdc, // handle of device context int XPos, // x-coordinate of pixel int nYPos // y-coordinate of pixel );
H hannuman Unregistered / Unconfirmed GUEST, unregistred user! 2005-07-23 #4 int1:=integer(canvas.Pixels[X, Y]);
H huaxuewang Unregistered / Unconfirmed GUEST, unregistred user! 2005-07-23 #5 先用tcanvas类的TColor取得像素的颜色,然后从Tcolor用与操作分离分量颜色,如:c,cr:TColor; c:=取得颜色值 cr:=(c and $FF);//取得红色分量值,int 型的
先用tcanvas类的TColor取得像素的颜色,然后从Tcolor用与操作分离分量颜色,如:c,cr:TColor; c:=取得颜色值 cr:=(c and $FF);//取得红色分量值,int 型的
C claire_cn Unregistered / Unconfirmed GUEST, unregistred user! 2005-07-24 #6 to ak_2005: 可以详细点吗,写几句代码可以吗? to hannuman: int1:=-1 ???/ (不论图画怎么改,都是-1) to huaxuewang: c:=取得颜色值 ?// 关键是如何取得,我不知道
to ak_2005: 可以详细点吗,写几句代码可以吗? to hannuman: int1:=-1 ???/ (不论图画怎么改,都是-1) to huaxuewang: c:=取得颜色值 ?// 关键是如何取得,我不知道
A ak_2005 Unregistered / Unconfirmed GUEST, unregistred user! 2005-07-24 #7 var p: TPoint; w: DWord; DC: HDC; begin DC := GetDC(0); GetCursorPos(p); w := GetPixel(DC, p.x, p.y); Result:=IntToStr(ColorToRGB(w)); end;
var p: TPoint; w: DWord; DC: HDC; begin DC := GetDC(0); GetCursorPos(p); w := GetPixel(DC, p.x, p.y); Result:=IntToStr(ColorToRGB(w)); end;