How see root figure image through transparent child [message #217998] |
Fri, 16 June 2006 10:41  |
Eclipse User |
|
|
|
Originally posted by: tuhlmann.agynamix.de
Hi all,
I have a question about transparent figures. I've searched older posts
and found hints but couldn't solve my problem. So please bear with me :)
I have created a ScalableFreeformRootEditPart and a top level EditPart
for my model which draws a FreeformLayer.
I'm overwriting paintFigure() in the FreeformLayer to make it paint an
image in the back (found that tip in the archive- thanks!) That one
works well.
Now I create child figures (a Panel with a StackLayout and other IFigure
objects in there) on top of that root figure.
I want them to be transparent so that the image would shine through.
Transparency works if I set the background color of the root figure.
That color would then appear in my child figures. But that mechanism
does not work with the image.
I hope you can give me some clues so I get this puzzle piece finally in
place.
Thank you very much,
Torsten.
|
|
|
|
|
Re: How see root figure image through transparent child [message #218811 is a reply to message #218040] |
Mon, 03 July 2006 07:41  |
Eclipse User |
|
|
|
Originally posted by: tuhlmann.agynamix.de
To answer myself:
I have subclassed the Panel that hold my child figure:
itsFigure = new Panel() {
@Override
protected void paintFigure(Graphics graphics)
{
Image img = getBackgroundImage();
if (img != null)
{
graphics.drawImage(img, 0, 0);
} else {
super.paintFigure(graphics);
}
}
};
The image is a 1 pixel transparent gif image. Works very nice!
Torsten Uhlmann wrote:
> CL [dnoyeb] Gilbert wrote:
>> Torsten Uhlmann wrote:
>>
>>> Hi all,
>>>
>>> I have a question about transparent figures. I've searched older posts
>>> and found hints but couldn't solve my problem. So please bear with me :)
>>>
>>> I have created a ScalableFreeformRootEditPart and a top level EditPart
>>> for my model which draws a FreeformLayer.
>>>
>>> I'm overwriting paintFigure() in the FreeformLayer to make it paint an
>>> image in the back (found that tip in the archive- thanks!) That one
>>> works well.
>>>
>>> Now I create child figures (a Panel with a StackLayout and other IFigure
>>> objects in there) on top of that root figure.
>>>
>>> I want them to be transparent so that the image would shine through.
>>> Transparency works if I set the background color of the root figure.
>>> That color would then appear in my child figures. But that mechanism
>>> does not work with the image.
>>>
>>> I hope you can give me some clues so I get this puzzle piece finally in
>>> place.
>>>
>>> Thank you very much,
>>> Torsten.
>>
>> So your saying the background color shines through the children but the
>> background image does not?
>>
>
> Yes, thats the case. If I set a background color (and an image), this
> one shines through the children. If I only set an image I see white
> shining through the children but never the image.
>
> Torsten.
|
|
|
Powered by
FUDForum. Page generated in 0.04065 seconds