locked
How to convert a Windows::UI::Xaml::Media::Brush into an ID2D1Brush?

    Question

  • Hi,

    Is there any way to convert a Windows::UI::Xaml::Media::Brush into an ID2D1Brush? I am developing a C# windows store app, where I have a some rectangle in xaml, I want to convert Media Brush to direct2d ID2D1Brush to obtain the FillRectangle.

    Please Help.

    Ashok

    Friday, June 28, 2013 4:39 AM

Answers

All replies

  • Hi,

    Is there any way to convert a Windows::UI::Xaml::Media::Brush into an ID2D1Brush? I am developing a C# windows store app, where I have a some rectangle Fill in xaml, I want to convert Media Brush to direct2d ID2D1Brush to obtain the FillRectangle.

    Please Help.

    Ashok

    Monday, July 1, 2013 4:33 AM
  • No. Unlike the XAML Brush type, an ID2D1Brush is not even a Windows Runtime object (it's a COM object), so there's no way the two types could be related. As such you can't do a type conversion between the two types.

    Visual C++ MVP | Website | Blog | @mikebmcl | Windows Store DirectX Game Template

    Saturday, July 6, 2013 6:55 AM
  • Hi,

    Thanks for your reply. Is it possible to render IXpsOMVisual visual in Direct2D environment. I want to render each xps page (IXpsOMVisual has each page Element) in Direct2D context and convert to image. Your answer will help to continue my work.

    Ashok

    Friday, July 12, 2013 11:50 AM