Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Filters out the content of an image, leaving lines at the edges of contrasting sections of the image.
The CLSID for this effect is CLSID_D2D1EdgeDetection.
Example image
Sample code
ComPtr<ID2D1Effect> edgeDetectionEffect;
m_d2dContext->CreateEffect(CLSID_D2D1EdgeDetection, &edgeDetectionEffect);
edgeDetectionEffect->SetInput(0, bitmap);
edgeDetectionEffect->SetValue(D2D1_EDGEDETECTION_PROP_STRENGTH, 0.5f);
edgeDetectionEffect->SetValue(D2D1_EDGEDETECTION_PROP_BLUR_RADIUS, 0.0f);
edgeDetectionEffect->SetValue(D2D1_EDGEDETECTION_PROP_MODE, D2D1_EDGEDETECTION_MODE_SOBEL);
edgeDetectionEffect->SetValue(D2D1_EDGEDETECTION_PROP_OVERLAY_EDGES, false);
edgeDetectionEffect->SetValue(D2D1_EDGEDETECTION_PROP_ALPHA_MODE, D2D1_ALPHA_MODE_PREMULTIPLIED);
m_d2dContext->BeginDraw();
m_d2dContext->DrawImage(edgeDetectionEffect.Get());
m_d2dContext->EndDraw();
Effect properties
The properties for the edge detection effect are defined by the D2D1_EDGEDETECTION_PROP enumeration.
Requirements
Requirement | Value |
---|---|
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 |