Imaging for windows 切分图片时报内存不足,无法显示图片
出现在部署在服务器上的时候,用远程桌面,最小化,或关闭远程桌面时出现
解决方法1:把imgde放在其他控件的后面,置底
项目里还吧imgde的visible设置为了false
解决方法2:把宽度,高度都设置为0,visible设置为0
//使用using释放com控件的内存,防止内存增长
using (AxImgeditLibCtl.AxImgEdit _imgCrop = new AxImgeditLibCtl.AxImgEdit())
{
_frmMain.Controls.Add(_imgCrop); //一定要添加到窗体上,否则不能显示图片
_imgCrop.AutoRefresh = true;
_imgCrop.Visible = false;
_imgCrop.Width = 0;
_imgCrop.Height = 0;
_imgCrop.Left = 0;
_imgCrop.Top = 0;
_imgCrop.ClearDisplay();
_frmMain.Controls.Remove(_imgCrop);
_imgCrop.Dispose();
}