Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Magnifying glass
Magnifying glass [message #180903] Wed, 11 May 2005 14:14 Go to next message
Jason Grant is currently offline Jason GrantFriend
Messages: 77
Registered: July 2009
Member
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 23:26 Go to previous message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
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: Mon Jan 30 19:29:19 GMT 2023

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

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

Back to the top