[]
ID2D1Bitmap1
[Guid("a898a84c-3873-4588-b08b-ebbf978df041")]
public class Bitmap1 : Bitmap, IDisposable, IUnknown
Initializes a new instance of the Bitmap1 class.
public Bitmap1(IntPtr nativePtr)
nativePtr
System.IntPtrThe native pointer.
Creates an Bitmap whose data is shared with another resource.
public static Bitmap1 Create(DeviceContext deviceContext, Surface surface, BitmapProperties1 bitmapProperties)
deviceContext
DeviceContextan instance of RenderTarget
surface
SurfaceAn Surface that contains the data to share with the new ID2D1Bitmap. For more information, see the Remarks section.
bitmapProperties
BitmapProperties1The pixel format and DPI of the bitmap to create . The Format portion of the pixel format must match the Format of data or the method will fail, but the alpha modes don't have to match. To prevent a mismatch, you can pass NULL or the value obtained from the {{D2D1::PixelFormat}} helper function. The DPI settings do not have to match those of data. If both dpiX and dpiY are 0.0f, the default DPI, 96, is used.
Creates an Bitmap whose data is shared with another resource.
public static Bitmap1 Create(DeviceContext deviceContext, Surface surface)
deviceContext
DeviceContextan instance of RenderTarget
surface
SurfaceAn Surface that contains the data to share with the new ID2D1Bitmap. For more information, see the Remarks section.
Creates a Direct2D bitmap from a pointer to in-memory source data.
public static Bitmap1 Create(DeviceContext deviceContext, Size2L size, DataStream dataStream, int pitch, BitmapProperties1 bitmapProperties)
deviceContext
DeviceContextan instance of RenderTarget
size
Size2LThe dimension of the bitmap to create in pixels.
dataStream
DataStreamA pointer to the memory location of the image data, or NULL to create an uninitialized bitmap.
pitch
intThe byte count of each scanline, which is equal to (the image width in pixels * the number of bytes per pixel) + memory padding. If srcData is NULL, this value is ignored. (Note that pitch is also sometimes called stride.)
bitmapProperties
BitmapProperties1The pixel format and dots per inch (DPI) of the bitmap to create.
Creates a Direct2D bitmap from a pointer to in-memory source data.
public static Bitmap1 Create(DeviceContext deviceContext, Size2L size, DataStream dataStream, int pitch)
deviceContext
DeviceContextan instance of RenderTarget
size
Size2LThe dimension of the bitmap to create in pixels.
dataStream
DataStreamA pointer to the memory location of the image data, or NULL to create an uninitialized bitmap.
pitch
intThe byte count of each scanline, which is equal to (the image width in pixels * the number of bytes per pixel) + memory padding. If srcData is NULL, this value is ignored. (Note that pitch is also sometimes called stride.)
Creates a Direct2D bitmap from a pointer to in-memory source data.
public static Bitmap1 Create(DeviceContext deviceContext, Size2L size, BitmapProperties1 bitmapProperties)
deviceContext
DeviceContextan instance of RenderTarget
size
Size2LThe dimension of the bitmap to create in pixels.
bitmapProperties
BitmapProperties1The pixel format and dots per inch (DPI) of the bitmap to create.
Creates a Direct2D bitmap from a pointer to in-memory source data.
public static Bitmap1 Create(DeviceContext deviceContext, Size2L size)
deviceContext
DeviceContextan instance of RenderTarget
size
Size2LThe dimension of the bitmap to create in pixels.
Creates a Bitmap from a wic bitmap.
public static Bitmap1 Create(DeviceContext deviceContext, BitmapSource wicBitmap, BitmapProperties1 bitmapProperties)
deviceContext
DeviceContextThe render target.
wicBitmap
BitmapSourceThe wic bitmap.
bitmapProperties
BitmapProperties1The bitmap properties.
Creates a Bitmap from a wic bitmap.
public static Bitmap1 Create(DeviceContext deviceContext, BitmapSource wicBitmapSource)
deviceContext
DeviceContextThe render target.
wicBitmapSource
BitmapSourceA reference to a BitmapSource wic bitmap.
void ID2D1Bitmap1::GetColorContext([Out, Optional] ID2D1ColorContext** colorContext)
public ColorContext GetColorContext()
D2D1_BITMAP_OPTIONS ID2D1Bitmap1::GetOptions()
public BitmapOptions GetOptions()
HRESULT ID2D1Bitmap1::GetSurface([Out, Optional] IDXGISurface** dxgiSurface)
public Surface GetSurface()
HRESULT ID2D1Bitmap1::Map([In] D2D1_MAP_OPTIONS options,[Out] D2D1_MAPPED_RECT* mappedRect)
public void Map(MapOptions options, out MappedRectangle mappedRect)
options
MapOptionsmappedRect
MappedRectangleMaps the given bitmap into memory.
public DataRectangle Map(MapOptions options)
options
MapOptionsThe options used in mapping the bitmap into memory.
a reference to the rectangle that is mapped into memory
The bitmap must have been created with the Read flag specified. The caller should try to unmap the memory as quickly as is feasable to release occupied DMA aperture memory.
HRESULT ID2D1Bitmap1::Unmap()
public void Unmap()
Performs an explicit conversion from System.IntPtr to Bitmap1.
public static explicit operator Bitmap1(IntPtr nativePointer)
nativePointer
System.IntPtr