PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

getpixel

i tried to implement a simple getpixel support in the surface class. the idea was to transform the x,y point so that m_Buffer->GetPixels(x,y) returns the correct pixel value. but i cant get it to work. is this approach possible to implement a getpixel method in the surface class??

i think its overkill to lock the surface just to get only one pixel.
To my own surprise, there is no GetPixel() in PocketFrog... If you don't want to wait for the next version (in about 2 weeks), you can do it yourself.

What you should do is add a "GetPixel" method to the Rasterizer class and the GraphicBuffer class. Follow what is done for SetPixel(), the same thing needs to be done... Only the signature of the method will change:

Pixel GetPixel() const { ... }