什么时候应该在应用程序中使用图片(jpg,png),什么时候应该使用XAML?
图片:
图片:
+ "easy" for the designer to create what he wants
+ are displayed the same on every computer
- fixed resolution
XAML
+ vector format (resolution independent, resize able, ...)
+ can be animated
+/- rendered by the client
- not as many effects available as for images or are really complex to create
- complex visual tree
我没有找到任何比较图像和XAML之间资源使用(CPU,RAM)的来源。
我个人认为所有东西都应该是XAML,但我不想拥有一个非常慢的应用程序。是否有任何关于使用XAML绘图的良好性能指南?
通过研究,我读到说您应该将所有内容放在XAML中,然后使用RenderTargetBitmap按需创建静态图像,但根据这篇文章,这将导致窗口在没有硬件加速的情况下被渲染。因此,我想知道它是否真的可以提高性能。无视它对编码者来说需要更多的工作这一事实。