how to clear the graphics(rectangle shape) in picturebox

别说谁变了你拦得住时间么 提交于 2019-12-19 09:24:19

问题


i created rectangle shape user control and i am using this user control in my application.In my application i am processing a image for different operations such as reading barcode from images etc.Here i have two possibility of processing a image, one is processing entire image and another is processing selected part of the image,i am selecting the specific part of the image using rectangle shape(this is user-control).so i have given two option in my GUI for this purpose one is Entire image and another is Rectangle.if i used rectangle first time for selection and next time i selected entire image,then previously selected rectangle shape was not removed from the picturebox.So how can i clear this Rectangle shape from my picturebox? The below image shows the Rectangle shape in picturebox


回答1:


Try this Graphics.clear(); or this.Invalidate();



来源:https://stackoverflow.com/questions/10442279/how-to-clear-the-graphicsrectangle-shape-in-picturebox

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!