Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Draw2d Figures with transparency
Draw2d Figures with transparency [message #162833] Tue, 28 December 2004 13:31 Go to next message
Eclipse UserFriend
Originally posted by: kardo.mail.pt

Hi,
How can I make a
Draw2d
RectanguleFigure
(extends Figure)
with transparency?

Thks in advanced.

Ricardo Marques
Re: Draw2d Figures with transparency [message #162880 is a reply to message #162833] Tue, 28 December 2004 15:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Don't fill in the figure's bounds, and it is transparent.

"Ricardo Marques" <kardo@mail.pt> wrote in message
news:cqrn7d$kqp$1@www.eclipse.org...
> Hi,
> How can I make a
> Draw2d
> RectanguleFigure
> (extends Figure)
> with transparency?
>
> Thks in advanced.
>
> Ricardo Marques
Re: Draw2d Figures with transparency [message #162887 is a reply to message #162880] Tue, 28 December 2004 15:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kardo.mail.pt

But I don't want transparent, I want with transparency. For example I want 50%
opaque or transparent. An Image has an alpha value.
Re: Draw2d Figures with transparency [message #162956 is a reply to message #162887] Wed, 29 December 2004 06:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eostroukhov.hotmail.com

There's no support for alpha values (at least I haven't seen any), but you
could try setXORFill(true). In the case you need trasparency for the
feedback painting, take a look at FigureUtilities::makeGhostShape.

"netb" <kardo@mail.pt> wrote in message news:cqrvam$f71$1@www.eclipse.org...
> But I don't want transparent, I want with transparency. For example I want
> 50%
> opaque or transparent. An Image has an alpha value.
Re: Draw2d Figures with transparency [message #163005 is a reply to message #162887] Wed, 29 December 2004 16:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

The only transparency support in SWT is via Image. You'll have to create a
transparent image, and paint the Image. It's a pretty expensive workaround.
You can stretch a small image. See ScrollableThumbnail for an example in
GEF.

boa sorte.

"netb" <kardo@mail.pt> wrote in message news:cqrvam$f71$1@www.eclipse.org...
> But I don't want transparent, I want with transparency. For example I want
50%
> opaque or transparent. An Image has an alpha value.
Re: Draw2d Figures with transparency [message #163050 is a reply to message #163005] Thu, 30 December 2004 12:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kardo.mail.pt

Hi have tried to use makeGhostShape() and it worked. It's not exactly what
I want but for now it will do.

But I will try this workarround, it could be better.

Muito Obrigado!


Randy Hudson wrote:

> The only transparency support in SWT is via Image. You'll have to create a
> transparent image, and paint the Image. It's a pretty expensive workaround.
> You can stretch a small image. See ScrollableThumbnail for an example in
> GEF.

> boa sorte.

> "netb" <kardo@mail.pt> wrote in message news:cqrvam$f71$1@www.eclipse.org...
>> But I don't want transparent, I want with transparency. For example I want
> 50%
>> opaque or transparent. An Image has an alpha value.
Re: Draw2d Figures with transparency [message #185057 is a reply to message #163050] Wed, 22 June 2005 07:11 Go to previous message
Tom K. is currently offline Tom K.Friend
Messages: 22
Registered: July 2009
Junior Member
Since 3.1 there is Alpha Transparency Supported in the Graphics class.
Here a snippet for a transparent Polygon (NON XOR)

public class TransparentPolygonFigure extends Polygon {

private int m_transparencyValue = 50;

private int m_transparencyValueOutline = 50;

protected void fillShape(Graphics g) {
// must call it before super
g.setAlpha(m_transparencyValue);
g.setAntialias(SWT.ON);
super.fillShape(g);

}

protected void outlineShape(Graphics g) {
// must call it before super
g.setAlpha(m_transparencyValueOutline);
g.setAntialias(SWT.ON);
super.outlineShape(g);
}

public void setTransparentFill(int value) {

m_transparencyValue = value;
}

public void setTransparentOutline(int value) {

m_transparencyValueOutline = value;
}

}

Ricardo Marques wrote:
> Hi have tried to use makeGhostShape() and it worked. It's not exactly
> what I want but for now it will do.
> But I will try this workarround, it could be better.
>
> Muito Obrigado!
>
>
> Randy Hudson wrote:
>
>> The only transparency support in SWT is via Image. You'll have to
>> create a
>> transparent image, and paint the Image. It's a pretty expensive
>> workaround.
>> You can stretch a small image. See ScrollableThumbnail for an example in
>> GEF.
>
>
>> boa sorte.
>
>
>> "netb" <kardo@mail.pt> wrote in message
>> news:cqrvam$f71$1@www.eclipse.org...
>>
>>> But I don't want transparent, I want with transparency. For example I
>>> want
>>
>> 50%
>>
>>> opaque or transparent. An Image has an alpha value.
>
>
>
Previous Topic:Do I need EditPolicy.LAYOUT_ROLE just to select a child?
Next Topic:guides on ruler not displaying properly
Goto Forum:
  


Current Time: Tue Dec 03 05:02:15 GMT 2024

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

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

Back to the top