利用GDI+在窗体上绘制线条,移动窗体到边缘后线条被擦除一部分,这个的解释是? GDI窗体重绘 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你自己画的东西要放到OnPaint事件中,这样在重绘时才不会丢失,设置image后,picturebox在的onpaint中会自动DrawImage(this.image, rect); 源码如下,看最后面那几句代码protected override void OnPaint(PaintEventArgs pe){ if (this.pictureBoxState[0x20]) { try { if (this.WaitOnLoad) { this.Load(); } else { this.LoadAsync(); } } catch (Exception exception) { if (ClientUtils.IsCriticalException(exception)) { throw; } this.image = this.ErrorImage; } } if (this.image != null) { this.Animate(); ImageAnimator.UpdateFrames(); Rectangle rect = (this.imageInstallationType == ImageInstallationType.ErrorOrInitial) ? this.ImageRectangleFromSizeMode(PictureBoxSizeMode.CenterImage) : this.ImageRectangle; pe.Graphics.DrawImage(this.image, rect); } base.OnPaint(pe);} 基本上就是你自己画线不一定都在系统重绘ui之后执行。放在onpaint里是一个办法,还有个简单办法把你画好的image作为backgroundimage赋值给窗体……那么系统就会把你画的内容作为窗体的一部分自动重绘了 关于C#模拟网页登录的问题 C# API编程 请问各位前辈!如何才能学好asp.net? 如何在ListView单元中使用combobox进行编辑? image类型到字符串 where 语句 多条件查询格式 水晶报表里面怎么添加月份字段? java 和 .net哪个更有前途? 求:一条语句改写! Dictionary扩展能支持泛型返回值? 关于wpf安装后卸载问题。 C#给文件添加属性标签项(右键-->属性-->"标签名")
{
if (this.pictureBoxState[0x20])
{
try
{
if (this.WaitOnLoad)
{
this.Load();
}
else
{
this.LoadAsync();
}
}
catch (Exception exception)
{
if (ClientUtils.IsCriticalException(exception))
{
throw;
}
this.image = this.ErrorImage;
}
}
if (this.image != null)
{
this.Animate();
ImageAnimator.UpdateFrames();
Rectangle rect = (this.imageInstallationType == ImageInstallationType.ErrorOrInitial) ? this.ImageRectangleFromSizeMode(PictureBoxSizeMode.CenterImage) : this.ImageRectangle;
pe.Graphics.DrawImage(this.image, rect);
}
base.OnPaint(pe);
}