How to create an image of a WPF UserControl at runtime

前端 未结 2 1203
死守一世寂寞
死守一世寂寞 2020-12-01 22:15

I\'ve created a WPF application which has a Canvas on which I place UserControls which are moveable and resizeable by the user (just like a Windows

2条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-01 22:48

    WPF applications really do require some fairly serious grunt; particularly in the graphics department and benefit greatly from having a decent video card present in the system. Even then the performance of WPF apps (if not carefully constructed) can leave much to be desired...

    That said, you could feasibly use FixedDocument to rasterise a UserControl, and then convert this into a GIF/JPG/PNG and put this in place of the control being resized... however I would expect that process itself to be as slow or slower than your current observed performance issues.

提交回复
热议问题