Tile effect

Use the tile effect to repeat the specified region of the image.

The CLSID for this effect is CLSID_D2D1Tile.

Example image

Before
The image before the effect.
After
The image after the transform.

 


ComPtr<ID2D1Effect> tileEffect;
m_d2dContext->CreateEffect(CLSID_D2D1Tile, &tileEffect);

tileEffect->SetInput(0, bitmap);

tileEffect->SetValue(D2D1_TILE_PROP_RECT, D2D1::RectF(0.0f, 0.0f, 256.0f, 192.0f));

m_d2dContext->BeginDraw();
m_d2dContext->DrawImage(tileEffect.Get());
m_d2dContext->EndDraw();

Effect properties

Display name and index enumerationType and default valueDescription

Rect

D2D1_TILE_PROP_RECT

D2D1_VECTOR_4F

{0.0f, 0.0f, 100.0f, 100.0f}

The region of the image to be tiled. This property is a D2D1_VECTOR_4F defined as: (left, top, right, bottom). The units are in DIPs.

 

Output bitmap

This effect generates a logically infinite sized bitmap.

You can tile an image and output a certain size without any additional effects by setting the size when you call ID2D1DeviceContext::DrawImage.

Requirements

Minimum supported clientWindows 8 and Platform Update for Windows 7 [desktop apps | Windows Store apps]
Minimum supported serverWindows 8 and Platform Update for Windows 7 [desktop apps | Windows Store apps]
Headerd2d1effects.h
Libraryd2d1.lib, dxguid.lib

 

Related topics

ID2D1Effect

 

 

Community Additions

ADD
Show:
© 2014 Microsoft