Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2001-02

How to implement TCanvas.Pixel[x,y] functionality in 500 easy steps...

5 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Marc Weustink
to Luis R. Hilario: Which is the sequence that is due to follow to implement something? For example: How one…
Shane Miller wrote 8 lines
How to implement Canvas.Pixels.. If you 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

Reply by email

Luis R. Hilario

Hello,

Which is the sequence that is due to follow to implement something?

For example:
How one implemented the rectangles or the lines?
Which archives are modified first?

I am interested in drawing pixels (and apparently somebody more).

Also this can be useful to learn to implement other things.

Please to enumerate the steps, like is a boy who learns to walk.

|-----------------------------| | Luis R. Hilario | | http://www.luisdigital.2y.net | |-----------------------------|

Reply by email

Luis R. Hilario
to Luis R. Hilario

That easy!
I thought that they were 501 steps :)

Tomorrow I will watch all that (1:00 AM ZZZzzz).

Shane Miller wrote 36 lines
How to implement Canvas.Pixels.. If you 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. Again, I'm not sure that it's working but it is written already. The SetPixel is also written. Whether it's working or not I'm not sure. All we need is someone to debug it for us (put in a few writeln's and see what's coming out of it). Shane ----- Original Message ----- From: "Luis R. Hilario" To: Sent: Saturday, February 24, 2001 11:07 AM Subject: [lazarus] Pixels > Hello, > > Which is the sequence that is due to follow to implement something? > > For example: > How one implemented the rectangles or the lines? > Which archives are modified first? > > I am interested in drawing pixels (and apparently somebody more). > > Also this can be useful to learn to implement other things. > > Please to enumerate the steps, like is a boy who learns to walk.
|-----------------------------| | Luis R. Hilario | | http://www.luisdigital.2y.net | |-----------------------------|

Reply by email

Shane Miller
to Luis R. Hilario: Which is the sequence that is due to follow to implement something? For example: How one…

How to implement Canvas.Pixels..

If you 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.

Again, I'm not sure that it's working but it is written already. The SetPixel is also written. Whether it's working or not I'm not sure. All we need is someone to debug it for us (put in a few writeln's and see what's coming out of it).

Shane

Earlier message 30 lines
----- Original Message ----- From: "Luis R. Hilario" To: Sent: Saturday, February 24, 2001 11:07 AM Subject: [lazarus] Pixels > Hello, > > Which is the sequence that is due to follow to implement something? > > For example: > How one implemented the rectangles or the lines? > Which archives are modified first? > > I am interested in drawing pixels (and apparently somebody more). > > Also this can be useful to learn to implement other things. > > Please to enumerate the steps, like is a boy who learns to walk. > -- > |-----------------------------| > | Luis R. Hilario | > | http://www.luisdigital.2y.net | > |-----------------------------| > > _________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

FoodTechnologist
to Luis R. Hilario: Which is the sequence that is due to follow to implement something? For example: How one…

Luis R. Hilario �����:

Show quoted text 43 lines
That easy! I thought that they were 501 steps :) Tomorrow I will watch all that (1:00 AM ZZZzzz). Shane Miller wrote: > > How to implement Canvas.Pixels.. > > If you 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. > > Again, I'm not sure that it's working but it is written already. The > SetPixel is also written. Whether it's working or not I'm not sure. All we > need is someone to debug it for us (put in a few writeln's and see what's > coming out of it). > > Shane > > ----- Original Message ----- > From: "Luis R. Hilario" > To: > Sent: Saturday, February 24, 2001 11:07 AM > Subject: [lazarus] Pixels > > > Hello, > > > > Which is the sequence that is due to follow to implement something? > > > > For example: > > How one implemented the rectangles or the lines? > > Which archives are modified first? > > > > I am interested in drawing pixels (and apparently somebody more). > > > > Also this can be useful to learn to implement other things. > > > > Please to enumerate the steps, like is a boy who learns to walk.

It's strange, isn't it? Line[to] works fine,but pixels don't!

Reply by email