[lazarus] How to implement TCanvas.Pixel[x,y] functionality in 500 easy steps...
Marc Weustink
marc at dommelstein.net
Sun Feb 25 09:40:47 EST 2001
At 22:20 24-02-01 -0600, Shane Miller wrote:
>How to implement Canvas.Pixels..
>
>If you look at canvas.inc you will see that the function GetPixel already
>exists so I'm not sure that it needs to be "implemented". Perhaps it simply
>needs to be debugged. In getpixel there is a CNSendMessage call that sends
>a LM_GetPixel message and a MSG variable to gtkobject.inc. The LM_GetPixel
>causes a call to GetPixel and in that function the PixColor of the
>TLMSetGetPixel should be set.
I don't know if we should use the LM_[G|S]etPixel messages here. IMO the
messages don't have a long life if you ask me. It is a little strange if
you look at all the other graphic functions we've implemented.
I think it would be nice if it is implemented through the API:
function GetPixel(DC: HDC; X, Y: Integer): COLORREF; stdcall;
function SetPixel(DC: HDC; X, Y: Integer; Color: COLORREF): COLORREF;
stdcall;
You can add these through the ApiWizz tool. Then only the GTKWinApi.inc
parts needs to be filled in.
Marc
More information about the Lazarus
mailing list