Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Rotating text
Rotating text [message #446299] Tue, 23 November 2004 11:59 Go to next message
Cameron Zemek is currently offline Cameron ZemekFriend
Messages: 9
Registered: July 2009
Junior Member
When drawing to the Canvas or when printing, how can you rotate text?
Re: Rotating text [message #446306 is a reply to message #446299] Tue, 23 November 2004 13:59 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
Write the text to an image and rotate the image. See:

http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet139.java?rev=HEAD& amp;content-type=text/vnd.viewcvs-markup


"Cameron Zemek" <grom358@yahoo.com.au> wrote in message
news:cnv8m7$iun$1@www.eclipse.org...
> When drawing to the Canvas or when printing, how can you rotate text?
>
Re: Rotating text [message #446378 is a reply to message #446306] Wed, 24 November 2004 01:41 Go to previous messageGo to next message
Cameron Zemek is currently offline Cameron ZemekFriend
Messages: 9
Registered: July 2009
Junior Member
Veronika Irvine wrote:

> Write the text to an image and rotate the image. See:

>
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet139.java?rev=HEAD& amp;content-type=text/vnd.viewcvs-markup

Does this method work if rotating by say 10 degrees? It seems this method
copies each pixel. So if rotating by any amount of degrees, isn't it
possible that the some pixel new location will end up at a co-ordinate of
another pixel?
Re: Rotating text [message #446391 is a reply to message #446378] Wed, 24 November 2004 11:44 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
This only works for rotation of 90 degrees.

"Cameron Zemek" <grom358@yahoo.com.au> wrote in message
news:co0ort$kap$1@www.eclipse.org...
> Veronika Irvine wrote:
>
>> Write the text to an image and rotate the image. See:
>
>>
> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet139.java?rev=HEAD& amp;content-type=text/vnd.viewcvs-markup
>
> Does this method work if rotating by say 10 degrees? It seems this method
> copies each pixel. So if rotating by any amount of degrees, isn't it
> possible that the some pixel new location will end up at a co-ordinate of
> another pixel?
>
>
Re: Rotating text [message #446398 is a reply to message #446391] Wed, 24 November 2004 15:09 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
Maybe you could use java 2d and then convert to an SWT Image using:

http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet156.java?rev=HEAD& amp;content-type=text/vnd.viewcvs-markup

"Veronika Irvine" <veronika_irvine@oti.com> wrote in message
news:co1s81$dov$1@www.eclipse.org...
> This only works for rotation of 90 degrees.
>
> "Cameron Zemek" <grom358@yahoo.com.au> wrote in message
> news:co0ort$kap$1@www.eclipse.org...
>> Veronika Irvine wrote:
>>
>>> Write the text to an image and rotate the image. See:
>>
>>>
>> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet139.java?rev=HEAD& amp;content-type=text/vnd.viewcvs-markup
>>
>> Does this method work if rotating by say 10 degrees? It seems this method
>> copies each pixel. So if rotating by any amount of degrees, isn't it
>> possible that the some pixel new location will end up at a co-ordinate of
>> another pixel?
>>
>>
>
>
Previous Topic:How I can actualize label in a thread?
Next Topic:CTabFolder and CTabItem
Goto Forum:
  


Current Time: Fri Mar 29 06:57:55 GMT 2024

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

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

Back to the top