Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Erasing something drawn with drawString
Erasing something drawn with drawString [message #447848] |
Sat, 18 December 2004 21: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 09:32   |
Eclipse User |
|
|
|
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 09:35   |
Eclipse User |
|
|
|
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 13: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 08:59   |
Eclipse User |
|
|
|
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 00: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: Sun Jul 13 18:30:35 EDT 2025
Powered by FUDForum. Page generated in 0.06136 seconds
|