locked
Direct2d effect in metro apps

    Question

  • I am trying to do some Direct2D image operations in a C++ metro app. There is built in support in Direct2D for built-in effects like adjusting brightness of an image. But there seems no built-in support for adjusting Contrast of an image in Direct2D. For example, the below code will adjust the brightness of an image(From MSDN).

    ComPtr<ID2D1Effect> brightnessEffect;
    m_d2dContext->CreateEffect(CLSID_D2D1Brightness, &brightnessEffect);
    
    brightnessEffect->SetValue(D2D1_BRIGHTNESS_PROP_BLACK_POINT, D2D1::Vector2F(0.0f, 0.2f));
    
    m_d2dContext->BeginDraw();
    m_d2dContext->DrawImage(brightnessEffect.Get());
    m_d2dContext->EndDraw();
    
    How can I change the Contrast of an image in similar manner?
    Wednesday, February 06, 2013 7:00 PM

Answers

All replies