transparent labels

E

E Lee

Is there a way to create labels that allow the background image to show
through, true transparency? I want to add a label to a picturebox image but
not show the label boundaries, blocking out the image.

-E
 
R

rocha.armando

Is there a way to create labels that allow the background image to show
through, true transparency?  I want to add a label to a picturebox imagebut
not show the label boundaries, blocking out the image.

-E

Hi, yes it is?

Code below:
//Add EventHanler to your picture1 Paint

private void Picture1_Paint(object sender, PaintEventArgs e)
{

StringFormat sfLeft = new StringFormat();
sfLeft.Alignment = StringAlignment.Near;
sfLeft.LineAlignment = StringAlignment.Center;
Rectangle drawBounds = Picture1.Bounds;
drawBounds.X -= Picture1.Location.X - 2;
drawBounds.Y -= Picture1.Location.Y;
e.Graphics.DrawString("TEXT TO WRITE", new Font("Tahoma",
9, FontStyle.Regular), new SolidBrush(Color.White), drawBounds,
sfLeft);

}


best Regards,
Armando Rocha
Portugal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top