G
Guest
Sirs
Maybe I have a reproductible bug that trows the folowing exception
Invalid Parameter Use
at System.Drawing.Graphics.DrawImage(Image image, Int32 x, Int32 y, Int32 width, Int32 height
at System.Drawing.Graphics.DrawImage(Image image, Rectangle rect
at System.Windows.Forms.PictureBox.OnPaint(PaintEventArgs pe
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs
at System.Windows.Forms.Control.WmPaint(Message& m
at System.Windows.Forms.Control.WndProc(Message& m
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m
at System.Windows.Forms.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.ComponentManager.System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData
at System.Windows.Forms.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context
at System.Windows.Forms.Application.Run(Form mainForm
at ImageWarpingClient.Form1.Main() in c:\documents and settings\camilo\my documents\visual studio projects\imagewarpingpanoramic\form1.cs:line 170" strin
I have one app with 2 PictureBox
I have two buttons to load this picture box. One of the buttons have the folowing code. The another is the same changing the picturebox
private void button1_Click(object sender, System.EventArgs e
openFileDialog1.InitialDirectory = "c:\\"
openFileDialog1.Filter = "jpg files (*.jpg)|*.mpg|All files (*.*)|*.*"
openFileDialog1.FilterIndex = 2
openFileDialog1.RestoreDirectory = true
if(openFileDialog1.ShowDialog() == DialogResult.OK
string str = openFileDialog1.FileName
if (pictureBox1.Image != null
pictureBox1.Image.Dispose()
pictureBox1.Image = new Bitmap(str)
pictureBox1.Width = pictureBox1.Image.Width
pictureBox1.Height = pictureBox1.Image.Height
pictureBox1.Visible = true
If I load the picturebox2 and after picturebox1 nothing happens, but if I load the picturebox1 and after the picturebox2 in any paint my program crashes
Any help? Ideas
Camilo
Maybe I have a reproductible bug that trows the folowing exception
Invalid Parameter Use
at System.Drawing.Graphics.DrawImage(Image image, Int32 x, Int32 y, Int32 width, Int32 height
at System.Drawing.Graphics.DrawImage(Image image, Rectangle rect
at System.Windows.Forms.PictureBox.OnPaint(PaintEventArgs pe
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs
at System.Windows.Forms.Control.WmPaint(Message& m
at System.Windows.Forms.Control.WndProc(Message& m
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m
at System.Windows.Forms.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.ComponentManager.System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData
at System.Windows.Forms.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context
at System.Windows.Forms.Application.Run(Form mainForm
at ImageWarpingClient.Form1.Main() in c:\documents and settings\camilo\my documents\visual studio projects\imagewarpingpanoramic\form1.cs:line 170" strin
I have one app with 2 PictureBox
I have two buttons to load this picture box. One of the buttons have the folowing code. The another is the same changing the picturebox
private void button1_Click(object sender, System.EventArgs e
openFileDialog1.InitialDirectory = "c:\\"
openFileDialog1.Filter = "jpg files (*.jpg)|*.mpg|All files (*.*)|*.*"
openFileDialog1.FilterIndex = 2
openFileDialog1.RestoreDirectory = true
if(openFileDialog1.ShowDialog() == DialogResult.OK
string str = openFileDialog1.FileName
if (pictureBox1.Image != null
pictureBox1.Image.Dispose()
pictureBox1.Image = new Bitmap(str)
pictureBox1.Width = pictureBox1.Image.Width
pictureBox1.Height = pictureBox1.Image.Height
pictureBox1.Visible = true
If I load the picturebox2 and after picturebox1 nothing happens, but if I load the picturebox1 and after the picturebox2 in any paint my program crashes
Any help? Ideas
Camilo