[]
IWICBitmap
[Guid("00000121-a8f2-4877-ba0a-fd2b6645fb94")]
public class Bitmap : BitmapSource, IDisposable, IUnknown
Initializes a new instance of the Bitmap class.
public Bitmap(IntPtr nativePtr)
nativePtr
System.IntPtrThe native pointer.
Initializes a new instance of the Bitmap class from a BitmapSource.
public static Bitmap Create(ImagingFactory factory, BitmapSource bitmapSource, RectL rectangle)
factory
ImagingFactoryThe factory.
bitmapSource
BitmapSourceThe bitmap source.
rectangle
RectLThe rectangle.
Initializes a new instance of the Bitmap class from a BitmapSource
public static Bitmap Create(ImagingFactory factory, BitmapSource bitmapSource, BitmapCreateCacheOption option)
factory
ImagingFactoryThe factory.
bitmapSource
BitmapSourceThe bitmap source ref.
option
BitmapCreateCacheOptionThe option.
Initializes a new instance of the Bitmap class from a memory location using DataRectangle.
public static Bitmap Create(ImagingFactory factory, int width, int height, Guid pixelFormat, DataRectangle dataRectangle, int totalSizeInBytes = 0)
factory
ImagingFactoryThe factory.
width
intThe width.
height
intThe height.
pixelFormat
System.GuidThe pixel format.
dataRectangle
DataRectangleThe data rectangle.
totalSizeInBytes
intSize of the buffer in dataRectangle. If == 0, calculate the size automatically based on the height and row pitch.
Initializes a new instance of the Bitmap class.
public static Bitmap Create(ImagingFactory factory, int width, int height, Guid pixelFormat, BitmapCreateCacheOption option)
factory
ImagingFactoryThe factory.
width
intThe width.
height
intThe height.
pixelFormat
System.GuidThe pixel format. PixelFormat for a list of valid formats.
option
BitmapCreateCacheOptionThe option.
Provides access to a rectangular area of the bitmap.
public BitmapLock Lock(RectL rcLockRef, BitmapLockFlags flags)
rcLockRef
RectLThe rectangle to be accessed.
flags
BitmapLockFlagsThe access mode you wish to obtain for the lock. This is a bitwise combination of BitmapLockFlags for read, write, or read and write access.
Value | Meaning |
---|---|
The read access lock. | |
The write access lock. |
?
A reference that receives the locked memory location.
Locks are exclusive for writing but can be shared for reading. You cannot call CopyPixels while the Bitmap is locked for writing. Doing so will return an error, since locks are exclusive.
Provides access to a rectangular area of the bitmap.
public BitmapLock Lock(BitmapLockFlags flags)
flags
BitmapLockFlagsThe access mode you wish to obtain for the lock. This is a bitwise combination of BitmapLockFlags for read, write, or read and write access.
Value | Meaning |
---|---|
The read access lock. | |
The write access lock. |
?
A reference that receives the locked memory location.
Locks are exclusive for writing but can be shared for reading. You cannot call CopyPixels while the Bitmap is locked for writing. Doing so will return an error, since locks are exclusive.
HRESULT IWICBitmap::Lock([In] const void* prcLock,[In] WICBitmapLockFlags flags,[Out] IWICBitmapLock** ppILock)
public BitmapLock Lock(IntPtr rcLockRef, BitmapLockFlags flags)
rcLockRef
System.IntPtrflags
BitmapLockFlagsInitializes a new instance of the Bitmap class from an array of pixel datas.
public static Bitmap New<T>(ImagingFactory factory, int width, int height, Guid pixelFormat, T[] pixelDatas, int stride = 0) where T : struct
factory
ImagingFactoryThe factory.
width
intThe width.
height
intThe height.
pixelFormat
System.GuidThe pixel format.
pixelDatas
T[]The pixel datas.
stride
intStride of a row of pixels (number of bytes per row). By default the stride is == 0, and calculated by taking the sizeof(T) * width.
T
HRESULT IWICBitmap::SetPalette([In, Optional] IWICPalette* pIPalette)
public void SetPalette(Palette paletteRef)
paletteRef
PaletteHRESULT IWICBitmap::SetResolution([In] double dpiX,[In] double dpiY)
public void SetResolution(double dpiX, double dpiY)
dpiX
doubledpiY
doublePerforms an explicit conversion from System.IntPtr to Bitmap.
public static explicit operator Bitmap(IntPtr nativePointer)
nativePointer
System.IntPtr