Determining a pixel's colour

daedalus_hammer
03-30-2003, 01:14 PM
Hi
How could I determine the colour of a point within a Image control?
I need this because I have a white background, and I use some Image controls as buttons, which are rectangular, but my buttons should be round, and I want to achieve some nice efects, but I can't if all the events apply to all the control (some of it has the same background as the form and it creates the ilusion of a round button).
Anyone knows how to determine what a pixel-s (or point or whatever -- I don't know whats the difference :) ) colour is?
Thanks

OnErr0r
03-30-2003, 01:21 PM
You could use the point method of the form its over called in the image_mousedown event. If the imagebox is not at 0,0 on the form, you'll need to adjust x/y to form coords from imagebox.

Robse
03-30-2003, 01:21 PM
You could use the GetPixel (http://www.allapi.net/apilist/GetPixel.shtml) API.

OnErr0r
03-30-2003, 01:24 PM
You could use the GetPixel (http://www.allapi.net/apilist/GetPixel.shtml) API.

GetPixel requires a hwnd, and the imagebox has none. I suppose he could use the method I described and the form's hwnd. But I don't think there would be any advantage.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum