0
如何使用dc.Rectangle在名为“bitmap_1”的wx.StaticBitmap图像上绘制矩形?我有坐标((754,483))必须绘制矩形的位置。如何在wxpython中的wx.StaticBitmap图像上绘制矩形
dc.DrawRectangle(10,10,200,200)`这给出了一个错误
Traceback (most recent call last):
File "C:\Users\Foster\Documents\Roland\ims project\newtagging2.py", line 129, in OnImageMouseOver
NameError: global name 'dc' is not defined
感谢您的输入,但我想绘制到名为“bitmap_1”的StaticBitmap,它是一个图像。基本上我创建照片查看器,并需要显示标签在图像上的位置,我想通过显示图像中的对象/人物被标记的矩形来做到这一点。 – user1401950
您仍然可以使用上述方法执行此操作,您可以在位图上绘制,然后在“StaticBitmap”上调用SetBitmap来更新显示。 – GP89