How can you render a path in several locations?

余生颓废 提交于 2019-12-11 14:18:52

问题


We have a path defined which we would like to render in several hundred different positions during the OnRender override. We know about the PushTransform method on the DC, but that seems to require a new TranslateTransform instance for each render, which means we end up with hundreds of TranslateTransform as well. That just doesn't seem efficient.

We've also tried a single TranslateTransform, then just changing it's X and Y locations with each render, but since WPF actually caches the drawing instructions and not the actual drawing, when it's finally time to render, they all render in the same location because they are sharing the same TranslateTransform using its last-set offsets.

So what's the best way to achieve this?

来源:https://stackoverflow.com/questions/13911653/how-can-you-render-a-path-in-several-locations

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!