K kevinfu Unregistered / Unconfirmed GUEST, unregistred user! 2001-02-09 #1 我用Api中的Getpixel读出来的总是$FFFFFFFF,为什么?
C Chenlili Unregistered / Unconfirmed GUEST, unregistred user! 2001-02-09 #2 var <br> rx,gx,bx:integer; <br> pchar; <br> c:byte; <br>begin <br>bitmap.handletype:=bmDIB; <br>bitmap.PixelFormat:=pf24bit; <br>for i:=0 to bitmap.height-1 do <br> begin <br> p:=bitmap.ScanLine; <br> for j:=1 to bitmap.width do <br> begin <br> c:=integer(p^)*rx+integer((p+1)^)*gx+integer((p+2)^)*bx; <br> p^:=chr(c); <br> (p+1)^:=chr(c); <br> (p+2)^:=chr(c); <br> inc(p,3); <br> end; <br> end;
var <br> rx,gx,bx:integer; <br> pchar; <br> c:byte; <br>begin <br>bitmap.handletype:=bmDIB; <br>bitmap.PixelFormat:=pf24bit; <br>for i:=0 to bitmap.height-1 do <br> begin <br> p:=bitmap.ScanLine; <br> for j:=1 to bitmap.width do <br> begin <br> c:=integer(p^)*rx+integer((p+1)^)*gx+integer((p+2)^)*bx; <br> p^:=chr(c); <br> (p+1)^:=chr(c); <br> (p+2)^:=chr(c); <br> inc(p,3); <br> end; <br> end;
王 王江 Unregistered / Unconfirmed GUEST, unregistred user! 2001-02-09 #3 if bitmap.canvas.pixel[x,y]= clred then 就行了
吕 吕雪松 Unregistered / Unconfirmed GUEST, unregistred user! 2001-02-09 #4 还可以用GetRValue,GetGValue,GetBValue分解颜色中的RGB值。