开发者

Paint background only once

开发者 https://www.devze.com 2023-01-08 00:36 出处:网络
I have a drawing graph on a panel. The drawing has 2 components: \"background\" Grid and \"foreground\" graph. The user can move the graph lines, but the background remains static (for a select开发者_

I have a drawing graph on a panel. The drawing has 2 components: "background" Grid and "foreground" graph. The user can move the graph lines, but the background remains static (for a select开发者_开发技巧ed time interval).

Re-drawing the background is a little expensive. Is there a way to keep the background "intact" and redraw the "foreground" graph only when moving the graph lines?


You could draw the background on a bitmap (acting as a buffer), and then just 'draw' the image every time.

0

精彩评论

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

关注公众号