Important alert: (current site time 4/24/2014 11:43:05 AM EDT)
 

winzip icon

FYI: Rotated Captions with Unicode WordBreaking

Email
Submitted on: 10/25/2007 1:07:04 PM
By: LaVolpe 
Level: Intermediate
User Rating: By 8 Users
Compatibility: VB 6.0
Views: 13545
author picture
(About the author)
 
     Use Windows to word break captions. Display text at zero, 90 & 270 degree rotations. Neat method of wordbreaking unicode text using Windows own wordbreaking algorithms vs trying to create your own. Added several properties to mimic DrawText to include clipping, accelerator keys, and more. Project nearly 100% complete. The API created unicode textbox is not subclassed, so it isn't controlled by the project, however, you can type and cut/copy/paste as needed. Next major addition will be a class version. Hmmm, a usercontrol-less, class-based unicode textbox would be a nice project ;)

 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 72 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

10/23/2007 12:34:25 AMenmity

@LaVolpe, do you know what does the sample Chinese text mean? it means: "god! what's wrong!!! any expert have a look at it? thanks very much!"

;)

(If this comment was disrespectful, please report it.)

 
10/23/2007 7:44:06 AMpietro ing. cecchi

*
**
***
so nice, so nice, so nice...:)
thanks, Keith!
***
**
*
(If this comment was disrespectful, please report it.)

 
10/23/2007 10:52:01 AMLight Templer

Hi Keith,
improve your chinese! You have written: "Dog teaches KungFu to a bad car." :-)))
Beside this: Great as usual! My ***** and regards - LiTE
(If this comment was disrespectful, please report it.)

 
10/23/2007 1:44:03 PMLaVolpe

Had no idea it was chinese, i just liked to pretty pictures. Truly had no idea what it said, got it from a Chinese programming site, so figured it couldn't be too bad.
(If this comment was disrespectful, please report it.)

 
10/23/2007 8:42:13 PMRonald Borla

sir.. can u make a text that can be stretched in vb runtime? perspective, skew... or whatever... (^^,) do u have the idea how to do it in VB?
(If this comment was disrespectful, please report it.)

 
10/24/2007 10:40:40 AMHaiFeng.Wang

VERY GOOD!
(If this comment was disrespectful, please report it.)

 
10/24/2007 11:28:51 AMLaVolpe

@Ronald. Simple skewing is Italics. Else something more complex probably best done by printing to bitmap & using drawing APIs to skew: PlgBlt or GDI+.

For all others, I think I have a good solution for accelerator/hot keys on captions, provide clipping support, and a few other enhancements. Will be posting changes probably this weekend.
(If this comment was disrespectful, please report it.)

 
10/24/2007 2:30:26 PMfancytom

VERY GOO..............D job. I need it.
But i need 180 degree rotations ,too.
Can you make it finish? if you let it any degree rotations that is more powerful .
Thank you very much.
(If this comment was disrespectful, please report it.)

 
10/24/2007 4:29:52 PMHeriberto Mantilla Santamaria

Another useful program 5*
(If this comment was disrespectful, please report it.)

 
10/25/2007 1:59:14 PMLaVolpe

180degree rotated text: upside down? Any angle rotation could be more complicated to determine wordbreaking, but worth playing with.
(If this comment was disrespectful, please report it.)

 
10/26/2007 2:52:02 AMhai2hai

Great! Could you make it as 2 controls: uniLavolpeTextBox and uniRotatedLavolpeLabel

Thanks!
(If this comment was disrespectful, please report it.)

 
10/26/2007 11:51:14 AMLaVolpe

hai2hai, been thinking about it. The label would be really easy using this code, the textbox would require subclassing

P.S. To all. Been looking at adding additional DT_Flag support like End_Ellipse, maybe Path_Ellipse, but that one may be way too complicated using TextOut; DrawText is easier & may be the alternative for that option.

Found a couple of minor calculation logic errors, will update when additional options appear ok. Will add a class to be used for usercontrol custom buttons which would pre-save many calculations & only re-linebreak as needed vs every repaint.
(If this comment was disrespectful, please report it.)

 
10/26/2007 3:22:50 PMskansoft

***** and thanks for sharing!!!
(If this comment was disrespectful, please report it.)

 
10/28/2007 3:55:10 AMVahid

dude that's great
(If this comment was disrespectful, please report it.)

 
10/30/2007 9:16:02 AMkibe

bestseller!
LaVolpe is Turbo Man!
(If this comment was disrespectful, please report it.)

 
12/3/2007 12:45:32 AMRana Sohaib

well 5 stars are from me *****
lavolpe, have you create a combo box just use in the "windows messenger" with the picture.....
please reply
and restict user to xyz@abc.com user name format
mailto:alisohaib555@hotmail.com
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.