开发者

Need a way to display image and draw on the image in Visual C++

开发者 https://www.devze.com 2023-02-20 17:30 出处:网络
The current way that I found was to make a bitmap and paint it into a picturebox, but there it is very slow when trying to scroll the panel (t开发者_JS百科he picturebox is inside a scrollable panel).

The current way that I found was to make a bitmap and paint it into a picturebox, but there it is very slow when trying to scroll the panel (t开发者_JS百科he picturebox is inside a scrollable panel).

Is there a better way to achieve this functionality?


Load the bitmap only when your picture box is created, then leave it in memory until the picture box is destroyed. Loading the bitmap every time OnPaint is called will destroy performance.

Also make sure you aren't re-painting your bitmap if you receive a WM_PAINT message and nothing has changed.


That image size, 1500x2000 will be slow. How about resizing it to 25% to show a preview and if a user wishes to see the whole image give them an alert it may take some time.

0

精彩评论

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

关注公众号