PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Compact Framework transparent labels

Reply

transparent labels

 
Thread Tools Rate Thread
Old 11-04-2008, 02:41 PM   #1
E Lee
Guest
 
Posts: n/a
Default transparent labels


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


  Reply With Quote
Old 11-04-2008, 03:10 PM   #2
rocha.armando@gmail.com
Guest
 
Posts: n/a
Default Re: transparent labels

On 11 Abr, 14:41, "E Lee" <e...@pinson3.com> wrote:
> 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
  Reply With Quote
Old 14-04-2008, 07:42 AM   #3
Christian Resma Helle
Guest
 
Posts: n/a
Default Re: transparent labels

I wrote an article about something like this
http://christian-helle.blogspot.com...s-in-netcf.html

You might want to search the archives as well
http://groups.google.com/group/micr...e92ca7beee4c4f8

--
Regards,
Christian Resma Helle
http://christian-helle.blogspot.com


"E Lee" <elee@pinson3.com> wrote in message
news:uxLL4m9mIHA.3532@TK2MSFTNGP05.phx.gbl...
> 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
>


  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off