在图片框清晰的图像 [英] Clear image on picturebox

查看:217
本文介绍了在图片框清晰的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


如何在图片框我可以明确的平局形象?
以下不帮我:

  pictbox.Image = NULL;
pictbox.Invalidate();
 

请帮忙!

修改

 私人无效pictbox_Paint(对象发件人,PaintEventArgs的E)
{
     图形G = e.Graphics;
     vl.Draw(G,楼盘tran.realListForInsert);
}

公共无效Draw(绘图克,裁判名单,其中,双> ARR)
{
    g.DrawRectangle(新笔(Brushes.Red,3),nodeArr [Convert.ToInt32(templstName)。pict.Location.X,nodeArr [Convert.ToInt32(templstName)。pict.Location.Y,25,25) ;
    g.DrawRectangle(新笔(Brushes.Green,3),nodeArr [Convert.ToInt32(templstArgName)。pict.Location.X,nodeArr [Convert.ToInt32(templstArgName)。pict.Location.Y,25,25) ;
    nodeArr [Convert.ToInt32(templstName)text.Text = ARR [Convert.ToInt32(templstArgName)]的ToString()。
    ARR [Convert.ToInt32(templstName)] = ARR [Convert.ToInt32(templstArgName)];
}
 

解决方案

正如其他人所说,设置图片属性应该工作。

如果不是这样,这可能意味着你使用的<一个href="http://msdn.microsoft.com/en-us/library/system.windows.forms.picturebox.initialimage.aspx">InitialImage属性来显示图像。如果这是事实确实如此,尝试属性设置为来代替:

  pictBox.InitialImage = NULL;
 


How can I clear draw image on picturebox?
The following doesn't help me:

pictbox.Image = null;
pictbox.Invalidate();

Please help!

EDIT

private void pictbox_Paint(object sender, PaintEventArgs e) 
{ 
     Graphics g = e.Graphics; 
     vl.Draw(g, ref tran.realListForInsert); 
} 

public void Draw(Graphics g, ref List<double> arr) 
{ 
    g.DrawRectangle(new Pen(Brushes.Red, 3), nodeArr[Convert.ToInt32(templstName)].pict.Location.X, nodeArr[Convert.ToInt32(templstName)].pict.Location.Y, 25, 25); 
    g.DrawRectangle(new Pen(Brushes.Green, 3), nodeArr[Convert.ToInt32(templstArgName)].pict.Location.X, nodeArr[Convert.ToInt32(templstArgName)].pict.Location.Y, 25, 25); 
    nodeArr[Convert.ToInt32(templstName)].text.Text = arr[Convert.ToInt32(templstArgName)].ToString(); 
    arr[Convert.ToInt32(templstName)] = arr[Convert.ToInt32(templstArgName)]; 
} 

解决方案

As others have said, setting the Image property to null should work.

If it doesn't, it might mean that you used the InitialImage property to display your image. If that's indeed the case, try setting that property to null instead:

pictBox.InitialImage = null;

这篇关于在图片框清晰的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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