本文介绍了关于循环中保存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,我在循环中有这段代码,当我尝试保存图像时,它返回给我,并显示有关GDI +的错误
这是我的代码
>
hi all
i have this code inside my loop and while i try to save the images, it returns to me with an error about GDI+
here's my code
color:red> i = 0 ; i < = tehPic.Height ;; i ++) |
{ |
/td> |
//垂直画线 |
drawLines.DrawLine(Pens.BlueViolet,i,0,i,tehPic.Height); |
Text.Replace(.bmp",.jpeg"),System.Drawing.Imaging.ImageFormat.Jpeg); |
color:red> a = 图片 .FromStream(File.Open(fileLocation.Text.Replace(.bmp",.jpeg"),FileMode.Open)); |
tehPic.Image |
线程.睡眠(1000); |
for(i=0; i <=tehPic.Height ; i++) |
{ |
//the horizontal drawline |
drawLines.DrawLine(Pens.BlueViolet,0,i,tehPic.Width,i); |
//the vertical drawline |
drawLines.DrawLine(Pens.BlueViolet, i, 0, i, tehPic.Height); |
imageToFilter.Save(fileLocation.Text.Replace(".bmp", ".jpeg"), System.Drawing.Imaging.ImageFormat.Jpeg); |
Image a = Image.FromStream(File.Open(fileLocation.Text.Replace(".bmp", ".jpeg"), FileMode.Open)); |
tehPic.Image = a; |
Thread.Sleep(1000); |
} |
推荐答案
这篇关于关于循环中保存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!