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.
Straighten Effect
Rotates and optionally scales an image.
The CLSID for this effect is CLSID_D2D1Straighten.
Example Image

Sample Code
ComPtr<ID2D1Effect> straightenEffect;
m_d2dContext->CreateEffect(CLSID_D2D1Straighten, &straightenEffect);
straightenEffect->SetInput(0, bitmap);
straightenEffect->SetValue(D2D1_STRAIGHTEN_PROP_ANGLE, 12.0f);
straightenEffect->SetValue(D2D1_STRAIGHTEN_PROP_MAINTAIN_SIZE, true);
straightenEffect->SetValue(D2D1_STRAIGHTEN_PROP_SCALE_MODE, D2D1_STRAIGHTEN_SCALE_MODE_LINEAR);
m_d2dContext->BeginDraw();
m_d2dContext->DrawImage(straightenEffect.Get());
m_d2dContext->EndDraw();
Effect Properties
The properties for the straighten effect are defined by the D2D1_STRAIGHTEN_PROP enumeration.
Requirements
| Minimum supported client | Windows 10 [desktop apps | Windows Store apps] |
|---|---|
| Minimum supported server | Windows 10 [desktop apps | Windows Store apps] |
| Header | d2d1effects_2.h |
| Library | d2d1.lib, dxguid.lib |
Related topics
Show: