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

Definition

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

public:
 static System::Windows::Media::Imaging::BitmapSource ^ CreateBitmapSourceFromHBitmap(IntPtr bitmap, IntPtr palette, System::Windows::Int32Rect sourceRect, System::Windows::Media::Imaging::BitmapSizeOptions ^ sizeOptions);
[System.Security.SecurityCritical]
public static System.Windows.Media.Imaging.BitmapSource CreateBitmapSourceFromHBitmap (IntPtr bitmap, IntPtr palette, System.Windows.Int32Rect sourceRect, System.Windows.Media.Imaging.BitmapSizeOptions sizeOptions);
static member CreateBitmapSourceFromHBitmap : nativeint * nativeint * System.Windows.Int32Rect * System.Windows.Media.Imaging.BitmapSizeOptions -> System.Windows.Media.Imaging.BitmapSource
Public Shared Function CreateBitmapSourceFromHBitmap (bitmap As IntPtr, palette As IntPtr, sourceRect As Int32Rect, sizeOptions As BitmapSizeOptions) As BitmapSource

Parameters

bitmap
IntPtr IntPtr IntPtr IntPtr

A pointer to the unmanaged bitmap.

palette
IntPtr IntPtr IntPtr IntPtr

A pointer to the bitmap's palette map.

sourceRect
Int32Rect Int32Rect Int32Rect Int32Rect

The size of the source image.

sizeOptions
BitmapSizeOptions BitmapSizeOptions BitmapSizeOptions BitmapSizeOptions

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

Returns

Security

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

Applies to

See also