We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now


Anti Alias'ed fonts

Medium Priority
Last Modified: 2013-12-02
Could Anyone Help me with drawing Anti-Aliasing Fonts
and Gradient Fills on A 'label' control in VB5 PE?

I REEEEEEEELLLLY need this for a Character Generator program
so pls pls pls pls reply.
Watch Question




You won't be able to use screen fonts and make them anti aliased unless the user has MS Screen Smoothing installed.  The only thing you can do on a machine where it is NOT installed, is to display the font as a graphic.  A label control would have its caption set with the text and font, but would not appear anti aliased without the utility from MS.  

Oh yeah... the gradiant fills..  You can do that with various objects in VB5, but not label controls to the best of my knowledge.  There are tons of bits of available code on the web to do the gradiant fills.

Here's the one I use and like best:

Sub Gradient(TheObject As Object, Redval&, Greenval&, Blueval&)

'TheObject can be any object that supports the Line method (like forms and pictures).
'Redval, Greenval, and Blueval are the Red, Green, and Blue starting values from 0 to 255.

Dim Step%, Reps%, FillTop%, FillLeft%, FillRight%, FillBottom%, HColor$

'This will create 63 steps in the gradient. This looks smooth on 16-bit and 24-bit color.
'You can change this, but be careful. You can do some strange-looking stuff with it...
Step = (TheObject.Height / 63)
FillLeft = 0
FillRight = TheObject.Width
FillBottom = FillTop + Step

'If you changed the number of steps, change the number of reps to match it.
'If you don't, the gradient will look all funny.
For Reps = 1 To 63
    TheObject.Line (FillLeft, FillTop)-(FillRight, FillBottom), RGB(Redval, Greenval, Blueval), BF
    'This decreases the RGB values to darken the color.
    'Lower the value for "squished" gradients. Raise it for incomplete gradients.
    'Also, if you change the number of steps, you will need to change this number.
    Redval = Redval - 4
    Greenval = Greenval - 4
    Blueval = Blueval - 4
    'This prevents the RGB values from becoming negative, which causes a runtime error.
    If Redval <= 0 Then Redval = 0
    If Greenval <= 0 Then Greenval = 0
    If Blueval <= 0 Then Blueval = 0
    FillTop = FillBottom
    FillBottom = FillTop + Step
End Sub

I didn't submit this as an answer, because I'm not entirely sure from your question if this was what you were after..  If it is, you can let me submit this as the answer.  K?




Where do I get MS Screen Smoothing From?

and Does ne1 know what VB5 uses instead of 'print' to print text onto objects the way vb4 does?
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview


Just Chekin the site out... brb


Not xactly what I wanted, but good enough

The other thing you could try (don't know how well it would work), is to try to use text in jpg, gif, or bmp pictures.  That way, you can antialias the text, and it would appear smooth on anyone's computer.  

Didn't know if you saw, but you go to your Display Properties in the Win95 Control Panel > Plus! to adjust the new features that that download gave you.  

Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.