I wish to make a bitmap image (.bmp) transparent using VB.NET code. Kindly help me.
+1
A:
I found the key was using the imageAttributes class. Basically set the color key to the color you are using to represent the transparent area, and use one of the drawImage calls that accepts an imageAttribute parameter...
Imports System.Drawing.Imaging
' and in a sub somewhere:
Private mImageAttributes As New ImageAttributes mImageAttributes.SetColorKey(Color.FromArgb(0, 220, 20, 255), Color.FromArgb(0, 220, 20, 255))
Dim imageRectangle As New Rectangle(pX, pY, pBitmap.Width, pBitmap.Height) e.Graphics.DrawImage(pBitmap, imageRectangle, 0, 0, pBitmap.Width, pBitmap.Height, GraphicsUnit.Pixel, mImageAttributes)
Codezy
2009-04-08 03:26:12
+1
A:
Everything you need to know about transparency with GDI+ (.NET windows forms applications).
Martin
2009-09-03 12:32:33