Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Erasing something drawn with drawString
Erasing something drawn with drawString [message #447848] |
Sun, 19 December 2004 02:16 |
Eclipse User |
|
|
|
Originally posted by: lindseygeorge.hotmail.com
I have a composite with a background image, and to show this image
properly, I use the drawString method for putting in text, instead of
labels. How can I erase one such text line, before updating it with a
new one?
Thanks,
Lindsey.
|
|
|
Re: Erasing something drawn with drawString [message #447865 is a reply to message #447848] |
Mon, 20 December 2004 14:32 |
Veronika Irvine Messages: 1272 Registered: July 2009 |
Senior Member |
|
|
Use Control.redraw(in, int, int, int, boolean). This will damage the area
you want to change and then in the paint event for that area, you draw it
correctly. You will have to draw the image as well as the text. You can
draw a portion of an image using GC.drawImage(Image image, int srcX, int
srcY, int srcWidth, int srcHeight, int destX, int destY, int destWidth, int
destHeight).
"Lindsey George" <lindseygeorge@hotmail.com> wrote in message
news:cq2odn$dl$1@www.eclipse.org...
>I have a composite with a background image, and to show this image
>properly, I use the drawString method for putting in text, instead of
>labels. How can I erase one such text line, before updating it with a new
>one?
>
> Thanks,
> Lindsey.
|
|
|
Re: Erasing something drawn with drawString [message #447866 is a reply to message #447865] |
Mon, 20 December 2004 14:35 |
Veronika Irvine Messages: 1272 Registered: July 2009 |
Senior Member |
|
|
Note also that org.eclipse.swt.custom.CLabel supports text over an image.
Use CLabel.setBackground(Image) to set an image in the background.
"Veronika Irvine" <veronika_irvine@oti.com> wrote in message
news:cq6nrj$7ap$1@www.eclipse.org...
> Use Control.redraw(in, int, int, int, boolean). This will damage the area
> you want to change and then in the paint event for that area, you draw it
> correctly. You will have to draw the image as well as the text. You can
> draw a portion of an image using GC.drawImage(Image image, int srcX, int
> srcY, int srcWidth, int srcHeight, int destX, int destY, int destWidth,
> int destHeight).
>
>
> "Lindsey George" <lindseygeorge@hotmail.com> wrote in message
> news:cq2odn$dl$1@www.eclipse.org...
>>I have a composite with a background image, and to show this image
>>properly, I use the drawString method for putting in text, instead of
>>labels. How can I erase one such text line, before updating it with a new
>>one?
>>
>> Thanks,
>> Lindsey.
>
>
|
|
|
Re: Erasing something drawn with drawString [message #447878 is a reply to message #447866] |
Mon, 20 December 2004 18:40 |
Eclipse User |
|
|
|
Originally posted by: lindseygeorge.hotmail.com
Thanks Veronika. However, does CLabel support transparency? My composite
has the background image, and I would prefer not to have break up the
image into multiple parts, and then assign one of these parts as a
background image to a CLabel.
Thanks,
Lindsey.
Veronika Irvine wrote:
> Note also that org.eclipse.swt.custom.CLabel supports text over an image.
> Use CLabel.setBackground(Image) to set an image in the background.
>
> "Veronika Irvine" <veronika_irvine@oti.com> wrote in message
> news:cq6nrj$7ap$1@www.eclipse.org...
>
>>Use Control.redraw(in, int, int, int, boolean). This will damage the area
>>you want to change and then in the paint event for that area, you draw it
>>correctly. You will have to draw the image as well as the text. You can
>>draw a portion of an image using GC.drawImage(Image image, int srcX, int
>>srcY, int srcWidth, int srcHeight, int destX, int destY, int destWidth,
>>int destHeight).
>>
>>
>>"Lindsey George" <lindseygeorge@hotmail.com> wrote in message
>>news:cq2odn$dl$1@www.eclipse.org...
>>
>>>I have a composite with a background image, and to show this image
>>>properly, I use the drawString method for putting in text, instead of
>>>labels. How can I erase one such text line, before updating it with a new
>>>one?
>>>
>>>Thanks,
>>>Lindsey.
>>
>>
>
>
|
|
|
Re: Erasing something drawn with drawString [message #447890 is a reply to message #447878] |
Tue, 21 December 2004 13:59 |
Veronika Irvine Messages: 1272 Registered: July 2009 |
Senior Member |
|
|
It doesn't. There is currently no support for transparency in SWT.
"Lindsey George" <lindseygeorge@hotmail.com> wrote in message
news:cq76fg$r33$1@www.eclipse.org...
> Thanks Veronika. However, does CLabel support transparency? My composite
> has the background image, and I would prefer not to have break up the
> image into multiple parts, and then assign one of these parts as a
> background image to a CLabel.
>
> Thanks,
> Lindsey.
>
> Veronika Irvine wrote:
>> Note also that org.eclipse.swt.custom.CLabel supports text over an image.
>> Use CLabel.setBackground(Image) to set an image in the background.
>>
>> "Veronika Irvine" <veronika_irvine@oti.com> wrote in message
>> news:cq6nrj$7ap$1@www.eclipse.org...
>>
>>>Use Control.redraw(in, int, int, int, boolean). This will damage the
>>>area you want to change and then in the paint event for that area, you
>>>draw it correctly. You will have to draw the image as well as the text.
>>>You can draw a portion of an image using GC.drawImage(Image image, int
>>>srcX, int srcY, int srcWidth, int srcHeight, int destX, int destY, int
>>>destWidth, int destHeight).
>>>
>>>
>>>"Lindsey George" <lindseygeorge@hotmail.com> wrote in message
>>>news:cq2odn$dl$1@www.eclipse.org...
>>>
>>>>I have a composite with a background image, and to show this image
>>>>properly, I use the drawString method for putting in text, instead of
>>>>labels. How can I erase one such text line, before updating it with a
>>>>new one?
>>>>
>>>>Thanks,
>>>>Lindsey.
>>>
>>>
>>
|
|
|
Re: Erasing something drawn with drawString [message #447948 is a reply to message #447865] |
Wed, 22 December 2004 05:16 |
Eclipse User |
|
|
|
Originally posted by: lindseygeorge.hotmail.com
Thanks Veronika! That worked!
Veronika Irvine wrote:
> Use Control.redraw(in, int, int, int, boolean). This will damage the area
> you want to change and then in the paint event for that area, you draw it
> correctly. You will have to draw the image as well as the text. You can
> draw a portion of an image using GC.drawImage(Image image, int srcX, int
> srcY, int srcWidth, int srcHeight, int destX, int destY, int destWidth, int
> destHeight).
>
>
> "Lindsey George" <lindseygeorge@hotmail.com> wrote in message
> news:cq2odn$dl$1@www.eclipse.org...
>
>>I have a composite with a background image, and to show this image
>>properly, I use the drawString method for putting in text, instead of
>>labels. How can I erase one such text line, before updating it with a new
>>one?
>>
>>Thanks,
>>Lindsey.
>
>
>
|
|
|
Goto Forum:
Current Time: Thu Sep 26 18:47:45 GMT 2024
Powered by FUDForum. Page generated in 0.04607 seconds
|