在vb.net中保存图像时,程序冻结
我在visual studio 2012中创建了一个winform程序,当单击另一个按钮时,它会将加载的图像保存到图片框中。我首先使用以下命令从用户处获取文件路径:在vb.net中保存图像时,程序冻结,vb.net,image,save-image,Vb.net,Image,Save Image,我在visual studio 2012中创建了一个winform程序,当单击另一个按钮时,它会将加载的图像保存到图片框中。我首先使用以下命令从用户处获取文件路径: PrePath = {FileSave.Text,"RawData",Welcome.File(nextimagecounter)} Path = IO.**Path**.Combine(PrePath) Imagea.BackgroundImage.Save(Path) 其中,PrePath是字符串数组,Path是字符串,Fil
PrePath = {FileSave.Text,"RawData",Welcome.File(nextimagecounter)}
Path = IO.**Path**.Combine(PrePath)
Imagea.BackgroundImage.Save(Path)
其中,PrePath
是字符串数组,Path
是字符串,FileSave.Text
是用户在txt框中输入的,Welcome.File(nextimagecounter)
是存储在数组文件中的字符串(使用.GetFiles
)Path=IO.Path.combine(PrePath)
,Imagea.Backgroundimage
是我要保存的背景图像
当我这样做时,我的程序将冻结,我需要到任务管理器结束它。它也抛出了这个错误
An unhandled exception of type
'System.Runtime.InteropServices.ExternalException' occurred in
System.Drawing.dll
其他信息:GDI+中发生一般错误
请注意,我也尝试通过以下方式拨打电话:
Imagea.Background.Save(FileSave.Text+"\RawData\"+Welcome.File(nextimagecounter)+".jpg")
这也不起作用,另一篇帖子让我找到了
Path.Combine
。任何帮助都将不胜感激 当你说“图像加载到<代码>图像框”时,你实际上是指图片框
控件吗?是的,我会进行编辑,谢谢。