Magnifying glass [message #180903] |
Wed, 11 May 2005 10:14  |
Eclipse User |
|
|
|
I've introduced a background "image layer" into my ScalableRootEditPart,
and now I'd like to have an Ellipse behave like a magnifying glass over
the image when the Ellipse is selected.
I'm assuming that I can get access to the image pixels that underly
the Ellipse, but I am unsure about how to fill an Ellipse with the pixels.
Here's what comes to mind:
Even though I want a round magnifier, it looks like it will be difficult
to paint pixels in a circle, ultimately because Graphics.drawImage and
o.e.swt.graphics.Image only deal with rectangular pixel dimensions.
Instead, I'm considering subclassing ImageFigure, and overriding setImage
to make pixels transparent if they're beyond a certain radius. This will
fake a round magnifier.
Does it sound like I'm on the right track?
|
|
|
Re: Magnifying glass [message #181014 is a reply to message #180903] |
Wed, 11 May 2005 19:26  |
Eclipse User |
|
|
|
The new SWT API allows you to set a non-rectangular clip.
"Jason Grant" <junk@logular.com> wrote in message
news:pan.2005.05.11.14.14.36.326811@logular.com...
> I've introduced a background "image layer" into my ScalableRootEditPart,
> and now I'd like to have an Ellipse behave like a magnifying glass over
> the image when the Ellipse is selected.
>
> I'm assuming that I can get access to the image pixels that underly
> the Ellipse, but I am unsure about how to fill an Ellipse with the pixels.
> Here's what comes to mind:
>
> Even though I want a round magnifier, it looks like it will be difficult
> to paint pixels in a circle, ultimately because Graphics.drawImage and
> o.e.swt.graphics.Image only deal with rectangular pixel dimensions.
> Instead, I'm considering subclassing ImageFigure, and overriding setImage
> to make pixels transparent if they're beyond a certain radius. This will
> fake a round magnifier.
>
> Does it sound like I'm on the right track?
|
|
|
Powered by
FUDForum. Page generated in 0.03426 seconds