MSDN > 論壇首頁 > Windows Presentation Foundation (WPF) > Is there a way to convert a Canvas based visual element to a Drawing based one?
發問發問
 

已答覆Is there a way to convert a Canvas based visual element to a Drawing based one?

  • Thursday, 2 July, 2009 22:31erick.thompson 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    I have a number of Canvas based images that I would like to use in my application. The problem is, the system that I am using requires Drawing based images. It appears that for clip-art like images, the two have the same capabilities. Is there a way, either in code or a tool, to convert Canvas XAML to Drawing XAML?

    Thanks,
    Erick

解答

  • Wednesday, 8 July, 2009 22:09mumin_abdul 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     已答覆
    Maybe you can adapt this: http://www.ericsink.com/wpf3d/7_XAML.html

    So maybe you could take a screen capture and then you can process it.
    Algorithms, Mathematics, and Programming http://www.algomaths.com/forum

所有回覆

  • Wednesday, 8 July, 2009 7:34Bruce.ZhouMSFT, 版主使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    Hi erick,

    Would you please elaborate the problem? Currently, I did not understand what you want.

    Best regards,
    Bruce Zhou
    Please mark the replies as answers if they help and unmark if they don't.
  • Wednesday, 8 July, 2009 17:55erick.thompson 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    Bruce,

    Thanks for the response. Basically, I have XAML content that is expressed in terms of Canvases. A Canvas with contained Rectangles, Paths, sub-Canvases, etc. The Canvas works fine in an WPF window, but the 3rd party API that I am using requires that the content be contained within Drawings. What I was hoping is that there is a way to convert the Canvas based content to Drawing based content (i.e., DrawingGroup).

    I fully understand that there isn't 100% overlap between the two, but the XAML that I am working with could be expressed in either.

    Does that give you enough information?

    Thanks,
    Erick
  • Wednesday, 8 July, 2009 22:09mumin_abdul 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     已答覆
    Maybe you can adapt this: http://www.ericsink.com/wpf3d/7_XAML.html

    So maybe you could take a screen capture and then you can process it.
    Algorithms, Mathematics, and Programming http://www.algomaths.com/forum
  • Thursday, 9 July, 2009 1:34erick.thompson 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    Thanks, I like the approach, and I believe that it should work.

    Erick