[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.platform.swt] Re: Get color under mouse position
|
Hi Oliver,
You do this by getting the pixel from the Image's ImageData. This is
demonstrated in swt's ImageAnalyzer example, method
#showColorForPixel(int,int). The easiest way to get this source is to
connect to dev.eclipse.org (step 1 of http://www.eclipse.org/swt/cvs.php )
and retrieve the org.eclipse.swt.examples project from HEAD.
Grant
"Oliver" <oliver.pfau@xxxxxxxxxxxxxxxxxxx> wrote in message
news:ce8fc920bcb65a945fd6354422170c5a$1@xxxxxxxxxxxxxxxxxx
> Hi,
>
> is there a possibility to get the color under the mouse ? It is an image
> drawn in a GC. But I do not know how to get the color. The image is drawn
> in different zoom levels and a magnifier can be switched on. To avoid the
> calculation of the image coordinates I am looking for a generic solution
> to capture the color under the mouse position. Idea ?
>
> Thanks,
> Oliver
>