VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Draw Text as LINES on Picture Box

by James Tracy (1 Submission)
Category: Graphics
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (2 Votes)

Occasionally, the ability to draw text on a picture box using the LINE method is needed, as it would allow complete control over a it's scale, location and other factors. This function accomplishes that by taking a string of characters and drawing them as lines, using the LINE method. Color, scale, rotation and other factors can be completely controlled.
The function is scale independent, so it doesn't matter if you're using twips, pixels, or any other measurement system. The letters are one square unit in size, by default. If you are using pixels, that means each character is one square pixel in size. If scaled up by a factor of 20, then one character would fit within exactly 20 pixels. You can control the scaling on both the X and Y-axis.
There are currently three fonts available, but fonts can be designed fairly easily. You can even design a font of your own handwriting. If you'd like to design your own font, just contact me at [email protected].
I wrote a little program that compiles the fonts from DXF files. I used AutoCAD release 14 to design the three fonts used by DrawText(), but any drawing program capable of outputting DXF files in AutoCAD release 14 format would work fine. I'd be happy to accept new fonts! The more the merrier. Be sure to contact me first, because there is an order to how the characters have to be arranged within a drawing file. As fonts are added, I'll either try to publish them somewhere, or you can just email me and ask if any new ones have been added - I'll send you the updated function if there are any.
ENJOY!
James Tracy
Sacramento, CA
[email protected]

Inputs
Dim sdtParms(0 To 10) As Single Dim idtParms(0 To 4) As Integer These two arrays contains the parameters passed to the DrawText() function.
Assumes
Nothing.
Code Returns
Nothing returned. The text is drawn on the specified object (usually a picture box).
Side Effects
None.
API Declarations
Dim sdtParms(0 To 10) As Single
Dim idtParms(0 To 4) As Integer

Rate Draw Text as LINES on Picture Box

Download Draw Text as LINES on Picture Box

Download Draw Text as LINES on Picture Box (83 KB)

Draw Text as LINES on Picture Box Comments

No comments have been posted about Draw Text as LINES on Picture Box. Why not be the first to post a comment about Draw Text as LINES on Picture Box.

Post your comment

Subject:
Message:
0/1000 characters