[]-35331/レス
Re[10]: 複数のPictureBox画像を複数のファイルへ保存したい
魔界の仮面弁士

最初--Image.FromStream(New MemoryStream(File.ReadAllBytes(bmpFile)))
PictureBox1.Image.Save(bmpFile, System.Drawing.Imaging.ImageFormat.Bmp)


'駄目な修正例1
PictureBox1.Image = Image.FromStream(New MemoryStream(File.ReadAllBytes(bmpFile)))
PictureBox1.Image.Dipose()
'System.ArgumentException: '使用されたパラメーターが有効ではありません。'
PictureBox1.Image.Save(bmpFile, System.Drawing.Imaging.ImageFormat.Bmp)


'駄目な修正例2
Using stm As New FileStream(bmpFile, FileMode.Open, FileAccess.Read)
 PictureBox1.Image = Image.FromStream(stm)
End Using
PictureBox1.Image.Save(bmpFile, System.Drawing.Imaging.ImageFormat.Bmp)


'駄目な修正例3
Using stm As New MemoryStream(File.ReadAllBytes(bmpFile))
 PictureBox1.Image = Image.FromStream(stm)
End Using
PictureBox1.Image.Save(bmpFile, System.Drawing.Imaging.ImageFormat.Bmp)



追記:こういう手もあるかな。

Using img = Image.FromFile(pngFile)
 PictureBox1.Image = N -->続き

01/16 16:14
[|]
次のレス>
35316のレス
35331にレスを書く
<前のレス

Child K-Tai