locked
GDI not supported

Answers

  • Native rendering code will need to be done with Direct2D.
    Jeff Lambert, Microsoft This posting is provided "AS IS" with no warranties, and confers no rights.
    Wednesday, September 14, 2011 5:58 PM
    Moderator

All replies

  • Native rendering code will need to be done with Direct2D.
    Jeff Lambert, Microsoft This posting is provided "AS IS" with no warranties, and confers no rights.
    Wednesday, September 14, 2011 5:58 PM
    Moderator
  • How do we get a Direct2D surface from a XAML control?
    Wednesday, September 14, 2011 8:52 PM
  • I believe that this talk by Kam VedBrat will help explain how to mix DirectX and metro apps: http://channel9.msdn.com/Events/BUILD/BUILD2011/PLAT-766T.  I did not attend the talk so I do not know if it covered D2D and Xaml though.

     

    Thursday, September 15, 2011 1:55 PM
  • Thanks for the reply Larry, the talk did actually have the answer to the question, not the answer I was hoping for, but I'm hoping that changes at some point. For anyone else interested, the following quote is from the Q&A session at the end of Kam's talk (@ 37mins):

     

    Attendee: Can XAML based UI live in the same application with DirectX based UI and then, if so, live in the same actual screen real-estate?

    Kam VedBrat: In the developer preview bits that you have today, that's not something that's supported.

    Thursday, September 15, 2011 8:58 PM
  • According to 

    http://msdn.microsoft.com/en-us/library/windows/apps/hh464945(v=VS.85).aspx

    GDI is not supported. But I have tonnes of code that render to a HDC. I looked

    at ID2D1GdiInteropRenderTarget but it is also not listed as supported. How do I keep all the code that renders to a HDC?

    I suppose the only way of achieving this right now is to use the XAML primitives (if you require traditional user interface elements, i.e. buttons, edit boxes etc) such as those in the Windows.UI.Xaml.Shapes namespace. If you don't require those traditional user interface elements, you can use Direct2D to draw to the entire screen.
    Thursday, September 15, 2011 9:08 PM
  • Thought I would never see this day.

     

    So if you want buttons and a rectangle that you can draw into in the same UI, use HTML5 and JavaScript, not C++!

     

     

    Friday, September 16, 2011 4:42 AM
  • Thought I would never see this day.

     

    So if you want buttons and a rectangle that you can draw into in the same UI, use HTML5 and JavaScript, not C++!

     

     

    I'm hoping it's just the developer preview which doesn't support it, as opposed to the WinRT itself. Fingers crossed for updated tools in the future.
    Friday, September 16, 2011 8:22 AM
  • I seconded that hope.
    samlsso
    Wednesday, October 26, 2011 5:29 AM