Export (0) Print
Expand All

ID2D1BitmapBrush::SetExtendModeX method

Specifies how the brush horizontally tiles those areas that extend past its bitmap.

Syntax


virtual void SetExtendModeX(
  D2D1_EXTEND_MODE extendModeX
) = 0;

Parameters

extendModeX

Type: D2D1_EXTEND_MODE

A value that specifies how the brush horizontally tiles those areas that extend past its bitmap.

Return value

This method does not return a value.

Remarks

Sometimes, the bitmap for a bitmap brush doesn't completely fill the area being painted. When this happens, Direct2D uses the brush's horizontal (SetExtendModeX) and vertical (SetExtendModeY) extend mode settings to determine how to fill the remaining area.

The following illustration shows the results from every possible combination of the extend modes for an ID2D1BitmapBrush: D2D1_EXTEND_MODE_CLAMP (CLAMP), D2D1_EXTEND_MODE_WRAP (WRAP), and D2D1_EXTEND_MIRROR (MIRROR).

Illustration of a bitmap and the resulting images from various extend modes

Examples

The following example shows how to set the bitmap brush's x- and y-extend modes to D2D1_EXTEND_MIRROR. It then paints the rectangle with the ID2D1BitmapBrush.

It produces the following output.

Illustration an original image and the resulting image from setting both x- and y- extend modes to mirror


m_pBitmapBrush->SetExtendModeX(D2D1_EXTEND_MODE_MIRROR);
m_pBitmapBrush->SetExtendModeY(D2D1_EXTEND_MODE_MIRROR);

m_pRenderTarget->FillRectangle(exampleRectangle, m_pBitmapBrush);


For the complete example, see the Draw Extend Mode Example. For more information about bitmap brushes, see the Brushes Overview.

Requirements

Minimum supported client

Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008 [desktop apps | Windows Store apps]

Minimum supported phone

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

Header

D2d1.h

Library

D2d1.lib

DLL

D2d1.dll

See also

ID2D1BitmapBrush::GetExtendModeX
ID2D1BitmapBrush

 

 

Community Additions

ADD
Show:
© 2014 Microsoft