Microsoft Developer Network > Página Inicial dos Fóruns > Windows Presentation Foundation (WPF) > Is there a way to convert a Canvas based visual element to a Drawing based one?
Fazer uma PerguntaFazer uma Pergunta
 

RespondidoIs there a way to convert a Canvas based visual element to a Drawing based one?

  • quinta-feira, 2 de julho de 2009 22:31erick.thompson Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    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

Respostas

  • quarta-feira, 8 de julho de 2009 22:09mumin_abdul Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     Respondido
    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
    • Marcado como Respostaerick.thompson quinta-feira, 9 de julho de 2009 1:34
    •  

Todas as Respostas

  • quarta-feira, 8 de julho de 2009 7:34Bruce.ZhouMSFT, ModeradorMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    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.
  • quarta-feira, 8 de julho de 2009 17:55erick.thompson Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    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
  • quarta-feira, 8 de julho de 2009 22:09mumin_abdul Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     Respondido
    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
    • Marcado como Respostaerick.thompson quinta-feira, 9 de julho de 2009 1:34
    •  
  • quinta-feira, 9 de julho de 2009 1:34erick.thompson Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    Thanks, I like the approach, and I believe that it should work.

    Erick