Mick
Thu Aug 05 14:14:56 CDT 2004
What's the problem with Bitmap.MakeTransparent()?
Try this code out.
Rectangle BitmapRect = Rectangle.FromLTRB(0, 0, button1.Width,
button1.Height);
BitmapRect.Inflate(-6, -6);
Bitmap srcImage = new Bitmap(@"c:\test.bmp");
srcImage.MakeTransparent();
Bitmap bmp = new Bitmap(BitmapRect.Width, BitmapRect.Height);
Graphics g = Graphics.FromImage(bmp);
//TopLeft corner
g.DrawImage(srcImage, Point.Empty);
//Topright corner
g.DrawImage(srcImage, BitmapRect.Width - srcImage.Width, 0, srcImage.Width,
srcImage.Height);
//BottomLeft corner
g.DrawImage(srcImage, 0, BitmapRect.Height - srcImage.Height,
srcImage.Width, srcImage.Height);
//BottomRight corner
g.DrawImage(srcImage, BitmapRect.Width - srcImage.Width, BitmapRect.Height -
srcImage.Height, srcImage.Width, srcImage.Height);
button1.Image = new Bitmap(bmp);
g.Dispose();
bmp.Dispose();
--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"Jeff" <backspin@sandwedge.com> wrote in message
news:OZOieQxeEHA.3348@TK2MSFTNGP12.phx.gbl...
> Mick,
>
> Thanks for the help. I'm looking at your code now.
> Wow, you worked hard on this one!
>
> I have been trying to get the bitmap approach to work, but have run into a
> Bitmap.MakeTransparent roadblock. This approach should be simple...
>
> If you have a moment, please look at my "Frustration..." post that
discusses
> the
> MakeTransparent bug.
>
> Regards, Jeff
>
>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
http://www.grisoft.com).
Version: 6.0.719 / Virus Database: 475 - Release Date: 12/07/2004