ControlPaint.CreateHBitmapTransparencyMask Method (Bitmap)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Creates a color mask for the specified bitmap that indicates which color should be displayed as transparent.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

[SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
public static IntPtr CreateHBitmapTransparencyMask(
	Bitmap bitmap


Type: System.Drawing.Bitmap

The Bitmap to create the transparency mask for.

Return Value

Type: System.IntPtr

The handle to the Bitmap mask.

You are responsible for de-allocating the bitmap.

.NET Framework
Available since 1.1
Return to top