Skip to main content



      Home
Home » Eclipse Projects » Mylyn » Displaying Images in an SWT StyledText
Displaying Images in an SWT StyledText [message #63243] Tue, 09 December 2008 05:18 Go to next message
Eclipse UserFriend
Hi David,

as in
http://greensopinion.blogspot.com/2008/09/beyond-rich-text-d isplaying-images-in.html ,
"Images don't flow with the text", but why can't using font metrics to
compute the number of blank spaces required to create enough horizontal
space (in pixels) to display the image without obscuring text?

Thanks!

Yau.
Re: Displaying Images in an SWT StyledText [message #63268 is a reply to message #63243] Tue, 09 December 2008 12:19 Go to previous messageGo to next message
Eclipse UserFriend
Yau wrote:
> Hi David,
>
> as in
> http://greensopinion.blogspot.com/2008/09/beyond-rich-text-d isplaying-images-in.html ,
> "Images don't flow with the text", but why can't using font metrics to
> compute the number of blank spaces required to create enough horizontal
> space (in pixels) to display the image without obscuring text?
>
> Thanks!
>
> Yau.
>
>

Yau, this is in fact difficult to do. Of course it is possible to pad
the text with spaces to have the text flow around the image, however
adjusting text flow and wrap as the control is resized is more than just
tricky.

The best place to implement this feature is in the StyledText control.
Given that StyledText paints to a Canvas and already handles text flow
and wrap, it's entirely possible for StyledText to be modified to handle
images as well. I recommend that you work with the SWT team if you are
interested in such a feature.
Re: Displaying Images in an SWT StyledText [message #63292 is a reply to message #63268] Tue, 09 December 2008 23:06 Go to previous messageGo to next message
Eclipse UserFriend
https://bugs.eclipse.org/bugs/show_bug.cgi?id=258228

"David Green" <dgreen99@gmail.com> wrote in message
news:ghm9el$b9m$1@build.eclipse.org...
> Yau wrote:
> > Hi David,
> >
> > as in
> >
http://greensopinion.blogspot.com/2008/09/beyond-rich-text-d isplaying-images-in.html ,
> > "Images don't flow with the text", but why can't using font metrics to
> > compute the number of blank spaces required to create enough horizontal
> > space (in pixels) to display the image without obscuring text?
> >
> > Thanks!
> >
> > Yau.
> >
> >
>
> Yau, this is in fact difficult to do. Of course it is possible to pad
> the text with spaces to have the text flow around the image, however
> adjusting text flow and wrap as the control is resized is more than just
> tricky.
>
> The best place to implement this feature is in the StyledText control.
> Given that StyledText paints to a Canvas and already handles text flow
> and wrap, it's entirely possible for StyledText to be modified to handle
> images as well. I recommend that you work with the SWT team if you are
> interested in such a feature.
Re: Displaying Images in an SWT StyledText [message #63338 is a reply to message #63292] Wed, 10 December 2008 15:05 Go to previous message
Eclipse UserFriend
Yau wrote:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=258228

Based on Felipe's response to your bug, it appears as if it's already
possible to flow images with the text. I've created bug 258348 as a result:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=258348
Re: Displaying Images in an SWT StyledText [message #595374 is a reply to message #63243] Tue, 09 December 2008 12:19 Go to previous message
Eclipse UserFriend
Yau wrote:
> Hi David,
>
> as in
> http://greensopinion.blogspot.com/2008/09/beyond-rich-text-d isplaying-images-in.html ,
> "Images don't flow with the text", but why can't using font metrics to
> compute the number of blank spaces required to create enough horizontal
> space (in pixels) to display the image without obscuring text?
>
> Thanks!
>
> Yau.
>
>

Yau, this is in fact difficult to do. Of course it is possible to pad
the text with spaces to have the text flow around the image, however
adjusting text flow and wrap as the control is resized is more than just
tricky.

The best place to implement this feature is in the StyledText control.
Given that StyledText paints to a Canvas and already handles text flow
and wrap, it's entirely possible for StyledText to be modified to handle
images as well. I recommend that you work with the SWT team if you are
interested in such a feature.
Re: Displaying Images in an SWT StyledText [message #595382 is a reply to message #63268] Tue, 09 December 2008 23:06 Go to previous message
Eclipse UserFriend
https://bugs.eclipse.org/bugs/show_bug.cgi?id=258228

"David Green" <dgreen99@gmail.com> wrote in message
news:ghm9el$b9m$1@build.eclipse.org...
> Yau wrote:
> > Hi David,
> >
> > as in
> >
http://greensopinion.blogspot.com/2008/09/beyond-rich-text-d isplaying-images-in.html ,
> > "Images don't flow with the text", but why can't using font metrics to
> > compute the number of blank spaces required to create enough horizontal
> > space (in pixels) to display the image without obscuring text?
> >
> > Thanks!
> >
> > Yau.
> >
> >
>
> Yau, this is in fact difficult to do. Of course it is possible to pad
> the text with spaces to have the text flow around the image, however
> adjusting text flow and wrap as the control is resized is more than just
> tricky.
>
> The best place to implement this feature is in the StyledText control.
> Given that StyledText paints to a Canvas and already handles text flow
> and wrap, it's entirely possible for StyledText to be modified to handle
> images as well. I recommend that you work with the SWT team if you are
> interested in such a feature.
Re: Displaying Images in an SWT StyledText [message #595406 is a reply to message #63292] Wed, 10 December 2008 15:05 Go to previous message
Eclipse UserFriend
Yau wrote:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=258228

Based on Felipe's response to your bug, it appears as if it's already
possible to flow images with the text. I've created bug 258348 as a result:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=258348
Previous Topic:Could not update Mylyn weekly on Eclipse 3.5 (m3)
Next Topic:Displaying data from database with WikiText
Goto Forum:
  


Current Time: Wed May 14 23:30:07 EDT 2025

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

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

Back to the top