Results 1 to 19 of 19

Thread: Rotating Text

  1. #1
    graphite
    Guest

    Lightbulb Rotating Text

    Hi All,

    I'm still having problem to having a rotating text/label. Is there any efficient way to achieve this?


    any help will be greatly appreciated


    Graphite

  2. #2
    Fanatic Member Kaverin's Avatar
    Join Date
    Oct 2000
    Posts
    930
    I know of something I could try to do, but it may be more complex than you need/want. With some API functions you can actually create fonts that are rotated to various angles, and then pop the font itself into a DC. If you did that to, say, a picturebox, any text printed from that point is going to be rotated in that manner. I can try to make up a fast control if you want this kind of thing (I might be able to use it later so I think I'll make it up anyway ).
    I'm baaaack...
    VB5 Professional Edition, VC++ 6
    Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se

    I feel special because I finally figured out how to loop midis: Post link
    I'm a fanatic too

  3. #3
    Fanatic Member Kaverin's Avatar
    Join Date
    Oct 2000
    Posts
    930
    Out of curiosity, how are you attempting to do the rotation? I've made up a control to do it, but I've never tried to persist an object inside a UC before. I'm getting varying results, but not a 100% working control. It does rotate text though. I'm trying to work out the way to keep the text centered relative to the extent of the control itself.
    I'm baaaack...
    VB5 Professional Edition, VC++ 6
    Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se

    I feel special because I finally figured out how to loop midis: Post link
    I'm a fanatic too

  4. #4
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    I would like to see this control.
    <removed by admin>

  5. #5
    Fanatic Member Kaverin's Avatar
    Join Date
    Oct 2000
    Posts
    930
    I put that in there except for the direction of rotation, but that's easy to add in. I never thought about it, but I'm so accustomed to using trig everywhere that I never think of doing anything but counterclockwise . I'm having a problem keeping the font info there though. I can persist a font object in other controls, but I think I may be losing a font object (as a result of DeleteObject and giving it the wrong one), and it's messing it up.
    I'm baaaack...
    VB5 Professional Edition, VC++ 6
    Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se

    I feel special because I finally figured out how to loop midis: Post link
    I'm a fanatic too

  6. #6
    Fanatic Member Kaverin's Avatar
    Join Date
    Oct 2000
    Posts
    930

    It's done! Mwhahahaha (finally).

    Well here it is. After many changes, and scrapping things that didn't work, and then kicking myself a lot after realizing I was trying to do the simplest of things complex ways (like attempting to persist the rotated font, which was a no no, so I switched to just repainting it on demand), I finished it. Tell me what you think, or if there are any problems.
    Attached Files Attached Files
    I'm baaaack...
    VB5 Professional Edition, VC++ 6
    Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se

    I feel special because I finally figured out how to loop midis: Post link
    I'm a fanatic too

  7. #7
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    It's not seeming to rotate for me. It just moves it around in the label. How do you use it? I am setting the angle to different degrees, but it doesn't do anything.
    <removed by admin>

  8. #8
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    Nevermind! I got it to work. I changed the font from MS Serif to Arial and it worked fine! Cool control. I'll be able to use this somewhere.
    ______________________________________________________________________
    I figured out what was wrong. If you have the font size the default, it doesn't rotate, but once you change the font size it works. MS Serif and 8 pt don't go together well. They play dirty.
    Last edited by MidgetsBro; Jun 26th, 2001 at 03:21 AM.
    <removed by admin>

  9. #9
    Fanatic Member Kaverin's Avatar
    Join Date
    Oct 2000
    Posts
    930
    Heh heh. I forgot to mention that. Only TrueType fonts can rotate, and the default font it has is part of the OEM charset (I think). TT is the ANSI charset. There's only a couple of those anyway. Like MS Serif, MS Sans Serif, Fixedsys etc. But any other font works fine. If you pick one of those, it will attempt to make a substitution if there is some angle specified. It will display any of them at 0° though.
    I'm baaaack...
    VB5 Professional Edition, VC++ 6
    Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se

    I feel special because I finally figured out how to loop midis: Post link
    I'm a fanatic too

  10. #10
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    If that is true, why did it work when I left it at MS Serif, but I changed the font size up one? Well it doesn't really matter, it's still a cool control.

    PS where are you in the world? It's like almost 2 AM here (California, USA)
    <removed by admin>

  11. #11
    Fanatic Member Kaverin's Avatar
    Join Date
    Oct 2000
    Posts
    930
    Hmm... well maybe there's just something about that font. Anyhow, it's not one I like . All my VB things get Tahoma, or Courier New if I need a monospace one.

    I'm 3 hours behind you, on the east coast in Virginia.
    I'm baaaack...
    VB5 Professional Edition, VC++ 6
    Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se

    I feel special because I finally figured out how to loop midis: Post link
    I'm a fanatic too

  12. #12
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    This is just a dumb question, but why are you posting so early in the morning?! Or is it late in the evening for u like it is for me?
    <removed by admin>

  13. #13
    Fanatic Member Kaverin's Avatar
    Join Date
    Oct 2000
    Posts
    930
    I'm a night person, and I don't sleep very much. I'm generally up until 4-5 am during the summer or when I don't have obligations that require me to be elsewhere at early times in the morning. During classes though I have to force myself to assume a "normal" schedule . But I do better during the summer when I can return to what I call a normal schedule. The time difference is 3 hours later. when it's 12 pm your time, it's 3 pm my time.
    I'm baaaack...
    VB5 Professional Edition, VC++ 6
    Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se

    I feel special because I finally figured out how to loop midis: Post link
    I'm a fanatic too

  14. #14
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573
    Originally posted by MidgetsBro
    If that is true, why did it work when I left it at MS Serif, but I changed the font size up one? Well it doesn't really matter, it's still a cool control.
    How did you change the font size?
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  15. #15
    Lively Member jkmcgrath's Avatar
    Join Date
    Dec 2004
    Posts
    79

    Re: It's done! Mwhahahaha (finally).

    Quote Originally Posted by Kaverin
    Well here it is. After many changes, and scrapping things that didn't work, and then kicking myself a lot after realizing I was trying to do the simplest of things complex ways (like attempting to persist the rotated font, which was a no no, so I switched to just repainting it on demand), I finished it. Tell me what you think, or if there are any problems.
    Bro!!!!!!!!

    This thing ROCKS!!!!!!!

    Thank you Thank you Thank you!!

  16. #16
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Rotating Text

    Hmmm... Guys, you do know that this thread is over 4 years old don't you? And Kaverin haven't been seen in these forums for almost 2 years...
    Last edited by Joacim Andersson; Oct 17th, 2005 at 07:44 PM.

  17. #17
    Fanatic Member Kaverin's Avatar
    Join Date
    Oct 2000
    Posts
    930

    Re: Rotating Text

    But reply on the thread, and poof, I can appear (thanks to getting an email about a response, otherwise I would have never thought about the forum again). I got really busy with work and other stuff, and didn't mess around with VB much for a long time, and one of the consequences was that I didn't hang around in the forums much either, and eventually I must have forgotten about it. For a while I was messing with VC++ 6 since I had just bought it around that time, so that also contributed to a decline in the VB things. The last thing I remember doing with VB was writing a program that I needed in the microbiology lab where I worked, but that was more than 2 years ago, and now I can't even remember what exactly it was for.

    I'm glad to see that people like what I had made though, even though it has been so long. I'm surprised that I could still remember my password and login, and that my account did still exist. Most of the people I remember posting quite a bit are probably moderators by now too.

    I may start hanging around again though and mess with VB/C++ some more to get familiar with it again, since this has piqued my interest again, and it would probably be useful in the future. I need to update that signature too... that thing is really outdated in the post preview I just looked at.
    I'm baaaack...
    VB5 Professional Edition, VC++ 6
    Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se

    I feel special because I finally figured out how to loop midis: Post link
    I'm a fanatic too

  18. #18
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: Rotating Text

    pretty cool how that worked out! welcome back

  19. #19
    Lively Member jkmcgrath's Avatar
    Join Date
    Dec 2004
    Posts
    79

    Re: Rotating Text

    Yes Welcome Back!

    I do have a question for you on your control. When I try to print the form I get an overflow error. I am using true type fonts as well.

    Can you help me with this please?

    Thanks,
    John

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width