Translucent Labels

VinnieMac
01-07-2005, 12:00 PM
Hi!

Is it possible to create translucent Labels in VB6?
It works for forms. But is it applicable to labels as well??

Thanx in advance.

00100b
01-07-2005, 12:35 PM
Set the Backstyle property of the control to 0-Transparent.

VinnieMac
01-10-2005, 07:37 AM
But Transparency isn't Translucency (does that word exist)??
Here's an example for a tranlucent label:

http://www.wrestlingtycoon.co.uk/gallery/gallery/wtshots/new2.jpg

The labels DO have a background color (blue in this case) ,,but you can still the background pic of the form...

Raaf
01-11-2005, 12:28 PM
check out the Alphablend (http://www.mentalis.org/apilist/AlphaBlend.shtml) function.

Use this to draw a rectangle (or another shape but this is slightly more complicated) with the desired transparancy.

Then put the text on top of it

noi_max
01-11-2005, 01:09 PM
Labels are lightweight controls... therfore they do not have an .Hwnd or .hdc property needed to do GDI functions with.

You may need to look at possibly using a picturebox with the alphablend mentioned earlier.

As far as getting text to the picturebox, you can look up the DrawText API.

Here's an example of using DrawText to put text on a picbox.
I used GetClientRect to determine the area for DrawText.
http://www.xtremevbtalk.com/showthread.php?t=205483

Some constants for DrawText that may be missing from AllAPI

Const DT_SINGLELINE = &H20
Const DT_NOCLIP = &H100
Const DT_CENTER = &H1
Const DT_VCENTER = &H4
Const DT_WORDBREAK = &H10
Const DT_CALCRECT = &H400


Also, since this is still up... here's Ricardo's Alpha-blend tutorial.
It's used in a 'game' style example, but is useful for understanding how the Alpha blend process works.
http://nascimentoweb.com.sapo.pt/VBTuts/BasicAlphaBlending.htm

Have fun!

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum