Imaging.CreateBitmapSourceFromMemorySection Method

Definition

Returns a managed BitmapSource, based on the provided unmanaged memory location.

C#
[System.Security.SecurityCritical]
public static System.Windows.Media.Imaging.BitmapSource CreateBitmapSourceFromMemorySection (IntPtr section, int pixelWidth, int pixelHeight, System.Windows.Media.PixelFormat format, int stride, int offset);
C#
public static System.Windows.Media.Imaging.BitmapSource CreateBitmapSourceFromMemorySection (IntPtr section, int pixelWidth, int pixelHeight, System.Windows.Media.PixelFormat format, int stride, int offset);

Parameters

section
IntPtr

A pointer to a memory section.

pixelWidth
Int32

An integer that specifies the width, in pixels, of the bitmap.

pixelHeight
Int32

An integer that specifies the height, in pixels, of the bitmap.

format
PixelFormat

A value of the enumeration.

stride
Int32

The stride of the bitmap.

offset
Int32

The byte offset into the memory stream where the image starts.

Returns

The created BitmapSource.

Attributes

Applies to

Produit Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

See also