Direct2D: applying effect to entire window and specific areas in the client area

thebluetropics 1,046 Reputation points

An example from

   ComPtr<ID2D1Effect> gaussianBlurEffect;  
   m_d2dContext->CreateEffect(CLSID_D2D1GaussianBlur, &gaussianBlurEffect);  
   gaussianBlurEffect->SetInput(0, bitmap);  
   gaussianBlurEffect->SetValue(D2D1_GAUSSIANBLUR_PROP_STANDARD_DEVIATION, 3.0f);  

In the example above, I have understand how effect works in Direct2D. However, the example above is only limited to applying the effect into a bitmap (ID2D1Bitmap?).

What I want to achieve with Direct2D effect is:

  1. Applying the effect to specific areas
  2. Applying the effect to entire client area
Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,450 questions
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,564 questions
0 comments No comments
{count} votes

Accepted answer
  1. Castorix31 82,121 Reputation points

    Use ID2D1Effect::SetInputEffect to combine multiple effects

    A quick test with CLSID_D2D1Crop, CLSID_D2D1Scale and CLSID_D2D1GaussianBlur (bad quality GIF for Gaussian, but it is for the idea...) :


1 additional answer

Sort by: Most helpful
  1. Jeanine Zhang-MSFT 9,266 Reputation points Microsoft Vendor

    Hi, @thebluetropics

    According to the Doc: Effects

    You can use Direct2D to apply one or more high quality effects to an image or a set of images.

    ID2D1Effect::SetInput method: Sets the given input image by index.

    As far as I'm concerned, Direct2D Effects is limited to applying the effect to image.