Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 enter image description here

like image 830
Praveen Kumar Avatar asked Nov 18 '25 04:11

Praveen Kumar


1 Answers

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

like image 52
vnshetty Avatar answered Nov 20 '25 18:11

vnshetty