'駄目な修正例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 = New Bitmap(img) End Using PictureBox1.Image.Save(pngFile, System.Drawing.Imaging.ImageFormat.Bmp)