Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

D2D1_BITMAP_OPTIONS enumeration

Specifies how a bitmap can be used.

Syntax


typedef enum  { 
  D2D1_BITMAP_OPTIONS_NONE            = 0,
  D2D1_BITMAP_OPTIONS_TARGET          = 1,
  D2D1_BITMAP_OPTIONS_CANNOT_DRAW     = 2,
  D2D1_BITMAP_OPTIONS_CPU_READ        = 4,
  D2D1_BITMAP_OPTIONS_GDI_COMPATIBLE  = 8
} D2D1_BITMAP_OPTIONS;

Constants

D2D1_BITMAP_OPTIONS_NONE

The bitmap is created with default properties.

D2D1_BITMAP_OPTIONS_TARGET

The bitmap can be used as a device context target.

D2D1_BITMAP_OPTIONS_CANNOT_DRAW

The bitmap cannot be used as an input.

D2D1_BITMAP_OPTIONS_CPU_READ

The bitmap can be read from the CPU.

D2D1_BITMAP_OPTIONS_GDI_COMPATIBLE

The bitmap works with ID2D1GdiInteropRenderTarget::GetDC.

Note  This flag is not available in Windows Store apps.
 

Remarks

D2D1_BITMAP_OPTIONS_NONE implies that none of the flags are set. This means that the bitmap can be used for drawing from, cannot be set as a target and cannot be read from by the CPU.

D2D1_BITMAP_OPTIONS_TARGET means that the bitmap can be specified as a target in ID2D1DeviceContext::SetTarget. If you also specify the D2D1_BITMAP_OPTIONS_CANNOT_DRAW flag the bitmap can be used a target but, it cannot be drawn from. Attempting to draw with a bitmap that has both flags set will result in the device context being put into an error state with D2DERR_BITMAP_CANNOT_DRAW.

D2D1_BITMAP_OPTIONS_CPU_READ means that the bitmap can be mapped by using ID2D1Bitmap1::Map. This flag requires D2D1_BITMAP_OPTIONS_CANNOT_DRAW and cannot be combined with any other flags. The bitmap must be updated with the CopyFromBitmap or CopyFromRenderTarget methods.

Note  You should only use D2D1_BITMAP_OPTIONS_CANNOT_DRAW is when the purpose of the bitmap is to be a target only or when the bitmap will be mapped .
 

D2D1_BITMAP_OPTIONS_GDI_COMPATIBLE means that it is possible to get a DC associated with this bitmap. This must be used in conjunction with D2D1_BITMAP_OPTIONS_TARGET. The DXGI_FORMAT must be either DXGI_FORMAT_B8G8R8A8_UNORM or DXGI_FORMAT_B8G8R8A8_UNORM_SRGB.

Requirements

Minimum supported client

Windows 8 and Platform Update for Windows 7 [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2012 and Platform Update for Windows Server 2008 R2 [desktop apps | Windows Store apps]

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Header

D2d1_1.h

See also

ID2D1DeviceContext::CreateBitmap

 

 

Show:
© 2016 Microsoft