且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

GDI +如何擦除旧图像并为基于图像的按钮绘制新图像?

更新时间:2023-12-05 15:40:46

通过 WM_PAINT 更改渲染中使用的数据中的图像,并在适当大小和位置的矩形上调用 InvalidateRect http://msdn.microsoft.com/en- us / library / windows / desktop / dd145002%28v = vs.85%29.aspx [ ^ ]或http://msdn.microsoft.com/en-us/library/2f3csed3%28v=vs.80%29.aspx [ ^ ]。



-SA
绘制图像的唯一位置是WM_PAINT;选择要在其他情况下绘制的图像。
Change the image in your data used in rendering via WM_PAINT and call InvalidateRect on the rectangle of proper size and position: http://msdn.microsoft.com/en-us/library/windows/desktop/dd145002%28v=vs.85%29.aspx[^] or http://msdn.microsoft.com/en-us/library/2f3csed3%28v=vs.80%29.aspx[^].

—SA
The only place for drawing the image is WM_PAINT; select the image to draw in the other cases.