如何清除图片框中的图形(矩形形状) [英] how to clear the graphics(rectangle shape) in picturebox

查看:344
本文介绍了如何清除图片框中的图形(矩形形状)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了矩形用户控件,并在我的应用程序中使用此用户控件.在我的应用程序中,我正在处理图像以进行不同的操作,例如从图像中读取条形码等.这里我有两种处理图像的可能性,一种是正在处理整个图像,另一个正在处理图像的选定部分,我正在使用矩形形状选择图像的特定部分(这是用户控制的).为此,我为此在GUI中提供了两个选项,一个是整个图像另一个是Rectangle.如果我第一次使用矩形进行选择,而下次我选择整个图像,则先前选择的矩形形状不会从图片框中删除.因此,如何从我的矩形中清除此矩形形状图片框? 下图显示了图片框中的矩形形状

解决方案

尝试使用此Graphics.clear();this.Invalidate();

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();

这篇关于如何清除图片框中的图形(矩形形状)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆