none
How to capture or render image of Canvas element RRS feed

  • Question

  • I have xaml grid control. and inside grid I have InkCanvas and textbox. I want to convert the whole grid as image. but i am getting only textbox content.

    I read canvas control will not work with RenderAsync.  But I want is, capture grid control as thumbnail. Is there any alternate way to do this. Please help me.

    Thanks,


    Pallam Madhukar Windows Phone Developer

    Monday, November 28, 2016 10:42 AM

All replies

  • Hello Pallam,

    This is a limitation for RenderTargetBitmap.RenderAsync to working with InkCanvas:

    See Rob's answer from here 

    “The rendered content needs to be in the main window's visual tree.” So that is why canvas cannot be used by this method.

    The alternate way to do this is to use Win2D

    Here is a simple document about it: 

    http://microsoft.github.io/Win2D/html/M_Microsoft_Graphics_Canvas_CanvasDrawingSession_DrawInk.htm

    Note, since you haven't tagged your question I'm not sure about your project type. Please notice the above method is only supported in Windows 10. 

    By the way, you can also search with your favorite search engine with this key word "Windows 10, UWP, InkCanvas and RenderTargetBitmap". There is a good blog about how you can do it with InkCanvas.

    Best regards,

    Barry 


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.





    • Edited by Barry Wang Wednesday, November 30, 2016 5:50 AM
    • Proposed as answer by Azat Tazayan Wednesday, November 30, 2016 6:22 AM
    Wednesday, November 30, 2016 5:42 AM