Skip to main content



      Home
Home » Eclipse Projects » GEF » Magnifying glass
Magnifying glass [message #180903] Wed, 11 May 2005 10:14 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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?
Previous Topic:children's visible within container
Next Topic:JDT sub-menu in my diagram's context menu !!!
Goto Forum:
  


Current Time: Tue May 13 01:20:12 EDT 2025

Powered by FUDForum. Page generated in 0.03426 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top