Page 1 of 1

How to read a pixel's color on a sprite ?

Posted: Thu Oct 02, 2003 10:21 am
by pythagoras_156
Greetings,

I've been trying to retrieve the color of a pixel on a sprite by using GetPixel_(hdc,x,y) but to no avail. I guess the problem is to get the correct dc for the sprite. This is what i've been doing (wrong, probably) :

Code: Select all

hDC = GetDC_(sprite_id) 
color = GetPixel_(hDC,50,30)
Does someone know the correct way to do this ?

Thanks in advance,

Pythagoras

Posted: Thu Oct 02, 2003 11:24 am
by LarsG

Code: Select all

  If StartDrawing(SpriteOutput(#sprite_id))
    color = Point(x,y)
    StopDrawing()
  EndIf
That might do it..
(you might want to do an RGB conversion on the color variable)


-Lars

Posted: Thu Oct 02, 2003 11:44 am
by pythagoras_156
Thanks, that dit it :D


Pythagoras