Jump to content

is there a way to rotate labels?


Recommended Posts

Is there any way to rotate a label to a certain degree?

_guictrlrotate($labelthatiwanttorotate, clockwise, 180)

That would rotate the label so that it would be upside down...

Is there a function or UDF that someone has made to do this?

If anyone could help me I would greatly appreciate it! :whistle:

What goes around comes around... Payback's a bitch.

Link to comment
Share on other sites

Ugh. Here is what's involved:

1) Save the current font handle

2) GetObject on the current font

3) Set the lfEscapement value of the LOGFONT record return to the angle to be rotated

4) CreateFontIndirect to create the new font

5) SelectObject to select the new font

6) Write the label text

7) SelectObject to restore the original font handle

8) DeleteObject to delete the temporary font

And this is just off the top of my head... :whistle:

Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

  • Developers

Ugh. Here is what's involved:

1) Save the current font handle

2) GetObject on the current font

3) Set the lfEscapement value of the LOGFONT record return to the angle to be rotated

4) CreateFontIndirect to create the new font

5) SelectObject to select the new font

6) Write the label text

7) SelectObject to restore the original font handle

8) DeleteObject to delete the temporary font

And this is just off the top of my head... :whistle:

I would just turn to whole damn screen ... ;)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Ugh. Here is what's involved:

1) Save the current font handle

2) GetObject on the current font

3) Set the lfEscapement value of the LOGFONT record return to the angle to be rotated

4) CreateFontIndirect to create the new font

5) SelectObject to select the new font

6) Write the label text

7) SelectObject to restore the original font handle

8) DeleteObject to delete the temporary font

And this is just off the top of my head... :whistle:

Blah, much to complicated...

1) Create the label using the standard GuiCreate method

2) Capture the Label, using one of one the graphics capture functions from the forum

3) Rotate the Graphic by using the 3D rotate function from the forum

See, easy! lol ;)

2015 - Still no flying cars, instead blankets with sleeves.

Link to comment
Share on other sites

Blah, much to complicated...

1) Create the label using the standard GuiCreate method

2) Capture the Label, using one of one the graphics capture functions from the forum

3) Rotate the Graphic by using the 3D rotate function from the forum

See, easy! lol ;)

Uh... no! (but you made me think there for a moment). :whistle: It should be that easy, but Microsoft took care of that for us...
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

If I really wanted to... I could make labels on the background color I want... put them all in paint... rotate them, and then save them all as different pictures, and create pictures in my GUI...

I don't really want to rotate the label after it is on the GUI, I want to have it rotated before It goes onto the GUI, but I guess if the function is made to rotate it after the GUI shows, that will be fine too. :whistle:

Thanks Valuater, for the link, I hope it will help me, just downloaded the file from peethebee's fileman! ;). Going to go test it ATM.

What goes around comes around... Payback's a bitch.

Link to comment
Share on other sites

If you created each letter as a label, then you could position each letter as you wanted with GUICtrlSetPos

This is a just a quick and dirty example... :whistle:

#include <GUIConstants.au3>
; == GUI generated with Koda ==);
$Test = GUICreate("AForm1", 312, 138, 192, 125)
GUISetFont(18, 400, 0, "MS Sans Serif")
$T  = GUICtrlCreateLabel("T", 16, 16, 20, 33, $WS_GROUP)
GUICtrlSetFont(-1, 18, 400, 0, "MS Sans Serif")
$H = GUICtrlCreateLabel("H", 40, 16, 21, 33, $WS_GROUP)
GUICtrlSetFont(-1, 18, 400, 0, "MS Sans Serif")
$I = GUICtrlCreateLabel("I", 64, 16, 10, 33, $WS_GROUP)
GUICtrlSetFont(-1, 18, 400, 0, "MS Sans Serif")
$S = GUICtrlCreateLabel("S", 72, 16, 20, 33, $WS_GROUP)
GUICtrlSetFont(-1, 18, 400, 0, "MS Sans Serif")
$I2 = GUICtrlCreateLabel("I", 104, 16, 10, 33, $WS_GROUP)
GUICtrlSetFont(-1, 18, 400, 0, "MS Sans Serif")
$S = GUICtrlCreateLabel("S", 112, 16, 20, 33, $WS_GROUP)
GUICtrlSetFont(-1, 18, 400, 0, "MS Sans Serif")
$T2 = GUICtrlCreateLabel("T", 136, 16, 20, 33, $WS_GROUP)
GUICtrlSetFont(-1, 18, 400, 0, "MS Sans Serif")
$E = GUICtrlCreateLabel("E", 160, 16, 20, 33, $WS_GROUP)
GUICtrlSetFont(-1, 18, 400, 0, "MS Sans Serif")
$X = GUICtrlCreateLabel("X", 184, 16, 21, 33, $WS_GROUP)
GUICtrlSetFont(-1, 18, 400, 0, "MS Sans Serif")
$T3 = GUICtrlCreateLabel("T", 208, 16, 20, 33, $WS_GROUP)
GUICtrlSetFont(-1, 18, 400, 0, "MS Sans Serif")

GUISetState(@SW_SHOW)

For $Xpos = 16 to 110
    GUICtrlSetPos($T2,136,$Xpos) 
    sleep(10)
Next

For $Xpos = 16 to 110
    GUICtrlSetPos($E,160,$Xpos) 
    sleep(10)
Next

For $Xpos = 16 to 110
    GUICtrlSetPos($X,184,$Xpos) 
    sleep(10)
Next

For $Xpos = 16 to 110
    GUICtrlSetPos($T3,208,$Xpos) 
    sleep(10)
Next
This shows the basic idea.

In the actual program you would use $Stringsplit to create each letter on its own and do some simple calculations to get the correct spacings.

You would then be able to position the letters however you want. ;)

2015 - Still no flying cars, instead blankets with sleeves.

Link to comment
Share on other sites

peethebee's functions are really great... but I don't think that is what I was looking for...

I don't really NEED this... It is just for a script I am making right now to make it look better, it is not essential that I have this... and lakes... there are like 1000 letters that i would have to make labels for! :whistle:

What goes around comes around... Payback's a bitch.

Link to comment
Share on other sites

peethebee's functions are really great... but I don't think that is what I was looking for...

I don't really NEED this... It is just for a script I am making right now to make it look better, it is not essential that I have this... and lakes... there are like 1000 letters that i would have to make labels for! :whistle:

Ok, a 1000 is a lot, sorry.

If I were doing this I would write a script to do it for me rather than do it by hand, this was just a quick proof of concept really, and it does`nt rotate the actual letters just moves them.

So that

THIS

could be come

T

H

I

S

or anything you want.

Edited by Lakes

2015 - Still no flying cars, instead blankets with sleeves.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...