Imaging.CreateBitmapSourceFromHBitmap Method (IntPtr, IntPtr, Int32Rect, BitmapSizeOptions)

 

Returns a managed BitmapSource, based on the provided pointer to an unmanaged bitmap and palette information.

Namespace:   System.Windows.Interop
Assembly:  PresentationCore (in PresentationCore.dll)

[SecurityCriticalAttribute]
public static BitmapSource CreateBitmapSourceFromHBitmap(
	IntPtr bitmap,
	IntPtr palette,
	Int32Rect sourceRect,
	BitmapSizeOptions sizeOptions
)

Parameters

bitmap
Type: System.IntPtr

A pointer to the unmanaged bitmap.

palette
Type: System.IntPtr

A pointer to the bitmap's palette map.

sourceRect
Type: System.Windows.Int32Rect

The size of the source image.

sizeOptions
Type: System.Windows.Media.Imaging.BitmapSizeOptions

A value of the enumeration that specifies how to handle conversions.

SecurityPermission

to return an object from this method. Associated enumeration: UnmanagedCode

.NET Framework
Available since 3.0
Return to top
Show: