AutoHotkey Community

It is currently May 27th, 2012, 6:36 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Text rotation
PostPosted: November 5th, 2010, 10:29 pm 
Offline

Joined: September 13th, 2010, 4:59 pm
Posts: 6
Location: Midwest
I have an application wherein I need to rotate a text fragment so that it runs vertically instead of the usual horizontal orientation. I could probably turn the text into an image, then use GDI to rotate it, ala TIC's excellent approach at http://www.autohotkey.net/~tic/Gdip.Tut ... .image.ahk, but before I go to all that trouble, does anyone have a simpler approach?

I'm about at my wit's end.

Thanks in advance


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 5th, 2010, 11:04 pm 
Offline

Joined: April 8th, 2009, 7:49 pm
Posts: 6073
Location: San Diego, California
Take a look at these links, I haven;t really evaluated them

Custom GUI Controls & GUI related
http://www.autohotkey.com/forum/topic19509.html

this link is listed in the 2nd poat of the above thread
New controls on GUI windows (Buttons, Statics, HMTL, RTF...)
http://www.autohotkey.com/forum/topic83 ... hlight=rtf

I think I see some text running vertically just left of the clock

Or to be really simple, you could use a narrow textbox with word-wrapping.

Or convert the text from this :arrow: vertical
to this

v
e
r
t
i
c
a
l


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 6th, 2010, 3:58 pm 
Offline

Joined: September 13th, 2010, 4:59 pm
Posts: 6
Location: Midwest
Thanks for you timely response, Leef ... I looked at the links but I worry that the techniques used there are more than a bit beyond my limited skill-set. Also, I didn't do a good job of explaining my problem in my initial post ... the narrow text box and vertical stacking of characters that you suggested won't help because I need to actually rotate each character 90 degrees - so that the text fragment looks "normal" if you rotate the page 90 degrees.

In other words, I need this:
Image

Hmmmm ... actually, just searching for the above image led me to a possible solution ... now - if I just knew how to use Silverlight ...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 6th, 2010, 5:54 pm 
Offline

Joined: April 8th, 2009, 7:49 pm
Posts: 6073
Location: San Diego, California
I understood you just wanted the whole block of text rotated, like you just showed.

If you look again at this link you can see "RotStatic" in 4 different orientations.
http://www.autohotkey.com/forum/topic83 ... hlight=rtf


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 6th, 2010, 6:25 pm 
Code:
Gui, Font, s12
Gui, add, Tab2, w30 h150 Right Buttons 0x8 disabled, Rotated Text|.||
Gui, show

Return

GuiClose:
ExitApp


:)


Report this post
Top
  
Reply with quote  
 Post subject: text rotation
PostPosted: November 6th, 2010, 7:32 pm 
Offline

Joined: September 13th, 2010, 4:59 pm
Posts: 6
Location: Midwest
Very clever, indeed, %Guest% ...

Sadly I need to do the rotation outside of a GUI (I actually need to rotate the text in something like NotePad and then send it to a printer).

But I surely do admire your ingenuity ... I never would have thought of using the slider/scroller thingie. Kudos.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 6th, 2010, 9:56 pm 
Offline

Joined: April 8th, 2009, 7:49 pm
Posts: 6073
Location: San Diego, California
@Uncle Wiggily,
Your requirements were not properly stated, or else they have changed.

You said nothing about printing, nothing about Notepad. :roll:

As you possibly know, GDI+ can be used to rotate text, and to generate images that can be printed.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 6th, 2010, 10:13 pm 
Offline

Joined: September 13th, 2010, 4:59 pm
Posts: 6
Location: Midwest
Leef:

You are correct ... I failed to describe the exact environment within which my script had to operate, and I did not specify the output mode, if any, of the script I am dealing with. My bad.

You are also correct in assuming that I know about the capabilities of GDI+ with regard to my problem; I had hoped that I might be able to find a simpler approach - I now see that is a misplaced hope.

Thanks for your help and attention.

Uncle Wiggily


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 6th, 2010, 10:30 pm 
Offline

Joined: April 8th, 2009, 7:49 pm
Posts: 6073
Location: San Diego, California
M.S. Paint

---or---

M.S. Paint & Wordpad combination ?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 22nd, 2010, 5:18 pm 
Offline

Joined: April 22nd, 2007, 6:33 pm
Posts: 1833
I am adding this option to Gdip_TextToGraphics


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 7th, 2011, 9:28 am 
Offline

Joined: December 28th, 2006, 9:46 am
Posts: 440
tic, did you get this added to Gdip_TextToGraphics?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 7th, 2011, 2:31 pm 
Offline

Joined: April 22nd, 2007, 6:33 pm
Posts: 1833
adamrgolf wrote:
tic, did you get this added to Gdip_TextToGraphics?


arg....I did actually write this, but it had one thing that needed fixing (vCentre with this option and specifying an x offset)....but now I can't find where I saved it!

Uncle Wiggily wrote:
Hmmmm ... actually, just searching for the above image led me to a possible solution ... now - if I just knew how to use Silverlight ...


Heh...yeh in wpf these things are trivial

Code:
        <TextBox Text="hello" Width="50" Height="20">
            <TextBox.RenderTransform>
                <RotateTransform Angle="90"/>
            </TextBox.RenderTransform>
        </TextBox>


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 7th, 2011, 7:26 pm 
Offline

Joined: December 28th, 2006, 9:46 am
Posts: 440
:( Dang, that stinks -- I hope you can find it, rotated text would be really helpful!

Thanks for all your work,

Adam


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: batto, Exabot [Bot], JSLover and 62 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group