DOBON.NETプログラミング道掲示板

■35318 / 2階層)  PictureBoxの画像を連続保存
□投稿者/ ま〜 一般人(39回)-(2023/01/11(Wed) 13:59:21)
  • アイコンいつもありがとうございます。

    >>ファイル保存の方は問題なく出来ると思うのですが
    > 思うだけで、まだ保存はできていないという事でしょうか。


    すみません
    説明不足でした。15個の PictureBoxに作画してる内容(画像)を15個ファイルに保存したいが目的です


    2つのPictureBoxに作画した状態で
    直前に作画を実行したPictureBoxにしか保存できない。1歩手前に作画したPictureBoxはエラーとなってしまします
    2個とも作画済みが条件で
    下記のコードで PictureBox1を再作画した後でSaveをするとPictureBox1は保存できる。PictureBox2はエラーとなります
    PictureBox2を再作画した後だとPictureBox1を保存するとエラーとなります

    PictureBox1.Image.Save(PicturePath + "MojiGAZou1.Png", System.Drawing.Imaging.ImageFormat.Png)
    PictureBox2.Image.Save(PicturePath + "MojiGAZou2.Png", System.Drawing.Imaging.ImageFormat.Png)

    エラー内容は下記通りです

    System.ArgumentException
    HResult=0x80070057
    Message=使用されたパラメーターが有効ではありません。
    Source=System.Drawing
    スタック トレース:
    at System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams)
    at System.Drawing.Image.Save(String filename, ImageFormat format)
    at 勉強.文字編集Form.Button10_Click(Object sender, EventArgs e) in C:\Users\userMM\OneDrive\ソフト\勉強\文字編集Form.vb:line 736
    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 勉強.My.MyApplication.Main(String[] Args) in :line 83

    以上、宜しくお願いします


違反を報告
削除キー/

前の記事(元になった記事) 次の記事(この記事の返信)
←Re[1]: PictureBoxの画像を連続保存 /魔界の仮面弁士 →Re[3]: PictureBoxの画像を連続保存 /魔界の仮面弁士
 
上記関連ツリー

Nomalアイコン PictureBoxの画像を連続保存 / ま〜 (23/01/10(Tue) 19:41) #35316
Nomalアイコン Re[1]: PictureBoxの画像を連続保存 / 魔界の仮面弁士 (23/01/10(Tue) 20:23) #35317
  └Nomalアイコン PictureBoxの画像を連続保存 / ま〜 (23/01/11(Wed) 13:59) #35318 ←Now
    └Nomalアイコン Re[3]: PictureBoxの画像を連続保存 / 魔界の仮面弁士 (23/01/11(Wed) 14:06) #35319
      └Nomalアイコン Re[4]: PictureBoxの画像を連続保存 / ま〜 (23/01/11(Wed) 16:06) #35320
        └Nomalアイコン Re[5]: PictureBoxの画像を連続保存 / ま〜 (23/01/11(Wed) 16:49) #35321
          └Nomalアイコン Re[6]: PictureBoxの画像を連続保存 / 魔界の仮面弁士 (23/01/11(Wed) 17:36) #35322
            └Nomalアイコン Re[7]: 複数のPictureBox画像を複数のファイルへ保存したい / ま〜 (23/01/12(Thu) 14:13) #35323
              └Nomalアイコン Re[8]: 複数のPictureBox画像を複数のファイルへ保存したい / 魔界の仮面弁士 (23/01/12(Thu) 16:00) #35324
                └Nomalアイコン Re[9]: 複数のPictureBox画像を複数のファイルへ保存したい / ま〜 (23/01/16(Mon) 14:20) #35330
                  └Nomalアイコン Re[10]: 複数のPictureBox画像を複数のファイルへ保存したい / 魔界の仮面弁士 (23/01/16(Mon) 16:14) #35331
                    └Nomalアイコン Re[11]: 複数のPictureBox画像を複数のファイルへ保存したい / ま〜 (23/01/20(Fri) 12:55) #35340 解決み!

All 上記ツリーを一括表示 / 上記ツリーをトピック表示
 
上記の記事へ返信

Mode/  Pass/


- Child Tree -