[]
        
(Showing Draft Content)

C1.Util.DX.Direct2D.Bitmap1.Create

Create Method

Create(DeviceContext, Size2L)

Creates a Direct2D bitmap from a pointer to in-memory source data.

Declaration
public static Bitmap1 Create(DeviceContext deviceContext, Size2L size)
Parameters
Type Name Description
DeviceContext deviceContext

an instance of RenderTarget

Size2L size

The dimension of the bitmap to create in pixels.

Returns
Type Description
Bitmap1

Create(DeviceContext, Size2L, BitmapProperties1)

Creates a Direct2D bitmap from a pointer to in-memory source data.

Declaration
public static Bitmap1 Create(DeviceContext deviceContext, Size2L size, BitmapProperties1 bitmapProperties)
Parameters
Type Name Description
DeviceContext deviceContext

an instance of RenderTarget

Size2L size

The dimension of the bitmap to create in pixels.

BitmapProperties1 bitmapProperties

The pixel format and dots per inch (DPI) of the bitmap to create.

Returns
Type Description
Bitmap1

Create(DeviceContext, Size2L, DataStream, int)

Creates a Direct2D bitmap from a pointer to in-memory source data.

Declaration
public static Bitmap1 Create(DeviceContext deviceContext, Size2L size, DataStream dataStream, int pitch)
Parameters
Type Name Description
DeviceContext deviceContext

an instance of RenderTarget

Size2L size

The dimension of the bitmap to create in pixels.

DataStream dataStream

A pointer to the memory location of the image data, or NULL to create an uninitialized bitmap.

int pitch

The 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.)

Returns
Type Description
Bitmap1

Create(DeviceContext, Size2L, DataStream, int, BitmapProperties1)

Creates a Direct2D bitmap from a pointer to in-memory source data.

Declaration
public static Bitmap1 Create(DeviceContext deviceContext, Size2L size, DataStream dataStream, int pitch, BitmapProperties1 bitmapProperties)
Parameters
Type Name Description
DeviceContext deviceContext

an instance of RenderTarget

Size2L size

The dimension of the bitmap to create in pixels.

DataStream dataStream

A pointer to the memory location of the image data, or NULL to create an uninitialized bitmap.

int pitch

The 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.)

BitmapProperties1 bitmapProperties

The pixel format and dots per inch (DPI) of the bitmap to create.

Returns
Type Description
Bitmap1

Create(DeviceContext, Surface)

Creates an Bitmap whose data is shared with another resource.

Declaration
public static Bitmap1 Create(DeviceContext deviceContext, Surface surface)
Parameters
Type Name Description
DeviceContext deviceContext

an instance of RenderTarget

Surface surface

An Surface that contains the data to share with the new ID2D1Bitmap. For more information, see the Remarks section.

Returns
Type Description
Bitmap1

Create(DeviceContext, Surface, BitmapProperties1)

Creates an Bitmap whose data is shared with another resource.

Declaration
public static Bitmap1 Create(DeviceContext deviceContext, Surface surface, BitmapProperties1 bitmapProperties)
Parameters
Type Name Description
DeviceContext deviceContext

an instance of RenderTarget

Surface surface

An Surface that contains the data to share with the new ID2D1Bitmap. For more information, see the Remarks section.

BitmapProperties1 bitmapProperties

The 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.

Returns
Type Description
Bitmap1

Create(DeviceContext, BitmapSource)

Creates a Bitmap from a wic bitmap.

Declaration
public static Bitmap1 Create(DeviceContext deviceContext, BitmapSource wicBitmapSource)
Parameters
Type Name Description
DeviceContext deviceContext

The render target.

BitmapSource wicBitmapSource

A reference to a BitmapSource wic bitmap.

Returns
Type Description
Bitmap1

Create(DeviceContext, BitmapSource, BitmapProperties1)

Creates a Bitmap from a wic bitmap.

Declaration
public static Bitmap1 Create(DeviceContext deviceContext, BitmapSource wicBitmap, BitmapProperties1 bitmapProperties)
Parameters
Type Name Description
DeviceContext deviceContext

The render target.

BitmapSource wicBitmap

The wic bitmap.

BitmapProperties1 bitmapProperties

The bitmap properties.

Returns
Type Description
Bitmap1