本題ですが先のコードでわDisposeした方が良いのか程度で書いてました Form LoadでDisposeしてますがボタンクリックでTextBoxから画像を生成して各PictureBoxに書いてますので問題ないと解釈していました 今二つの問題に当たっています。スレッドを分けなかったのは同じ要因かなと思ってです。
Dim Picture() As PictureBox = {PictureBox1, PictureBox2, PictureBox3, PictureBox4, PictureBox5} For i As Byte = 0 To 4 Picture(i).Size = New Size(Picture(i).Size.Width, 320) Picture(i).Size = New Size(Picture(i).Size.Height, 160) Picture(i).SizeMode = PictureBoxSizeMode.Zoom Picture(i).Image = Image.FromFile(PicturePath + "MojiGAZou" & CStr(i + 1) & ".bmp") Next
System.Runtime.InteropServices.ExternalException HResult=0x80004005 Message=GDI+ で汎用エラーが発生しました。 Source=System.Drawing スタック トレース: at System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams) at System.Drawing.Image.Save(String filename, ImageFormat format) at Test.文字編集Form.Button18_Click(Object sender, EventArgs e) in C:\Users\userMM\OneDrive\Test\文字編集Form.vb:line 232 at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine) at Test.My.MyApplication.Main(String[] Args) in :line 83