Board index » delphi » Pixel values from a bitmap

Pixel values from a bitmap

I have used loadfromfile() to load a Windows bitmap into a Timage component.
Now I would like to respond to a mouse down event by displaying the pixel
value for the current mouse location - as the
integer used to index the colour in the original bitmap (rather than as the
Tcolor given by the pixel property of the canvas).

Can anyone help me with this?

Thanks

 

Re:Pixel values from a bitmap


Quote
>>>>> "EffordM" == EffordM  <Effo...@landcare.cri.nz> writes:

 EffordM> I have used loadfromfile() to load a Windows bitmap into a
 EffordM> Timage component.  Now I would like to respond to a mouse
 EffordM> down event by displaying the pixel value for the current
 EffordM> mouse location - as the integer used to index the colour in
 EffordM> the original bitmap (rather than as the Tcolor given by the
 EffordM> pixel property of the canvas).

 EffordM> Can anyone help me with this?

Look up GetNearestPaletteIndex in the help file
(Might be NearestPaletteIndex or GetPaletteIndex or similar, but you
get the idea ;-)

Good luck.

Mads

--
+----------------------------------------------------------------------+
|  Mads Bondo Dydensborg.   Student at DIKU,  Copenhagen - Denmark.    |
|  Email: mads...@diku.dk   www: http://www.diku.dk/students/madsdyd/  |
+----------------------------------------------------------------------+

Other Threads