开发者

C# Faster Drawing Vector Graphics

开发者 https://www.devze.com 2022-12-11 21:47 出处:网络
In my application I want to draw polygons using Windows Create Graphics method and later edit the polygon by allowing the user to select the points of the polygon and allowing to re-position them.

In my application I want to draw polygons using Windows Create Graphics method and later edit the polygon by allowing the user to select the points of the polygon and allowing to re-position them.

I use moue move event to get the new position of the point to get the new coordinates of the point being moved and use Paint event to re-draw the polygon. The application is working but when a point is moved the movement is not smooth. This is probably due to large numbe of mouse move and paint events firing while 开发者_高级运维moving the point.

I dont know weather the mouse move or the paint event the performance hindrance.

Can anyone make a suggestion as to how to improve this?


look at double buffering in c#. this can speed thing up greatly.


From my Win32 expirience (not a .NET) the fastest vector graphic is Metafile. I dont know if the C# System.Drawing.Imaging.Metafile is as fast as Win32 one. Could be as fast as your video 2D hardware.

0

精彩评论

暂无评论...
验证码 换一张
取 消