简体   繁体   中英

how to clear the graphics(rectangle shape) in picturebox

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 在此输入图像描述

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM