avironman / OMRON---IFZ-Viewer

1 stars 1 forks source link

Small image disappears on keyboard click at zoom 100 and stick to the top-left corner #3

Open puz-ya opened 3 weeks ago

puz-ya commented 3 weeks ago

I put zoom = 100, magic starts: I press -> (left or right arrow) on the keyboard and image disappears. Then it appears in the top-left corner of the window. Also, in Debug output I see: `Exception thrown: 'System.OverflowException' in System.Drawing.dll System.OverflowException: Overflow error.   at System.Drawing.Graphics.CheckErrorStatus(Int32 status)   at System.Drawing.Graphics.DrawImage(Image image, Int32 x, Int32 y)   at OMRON_IFZ_Viewer.Form_DisplayImage.pictureBox1_Paint(Object sender, PaintEventArgs e) in D:\dev\c#_ifzviewer\Form_DisplayImage.cs:line 504

g.DrawImage(bmp, 0, 0);`

https://github.com/user-attachments/assets/bae42b7a-8545-486e-ac56-772bad8abbd1

When I click on empty window - image appears (but not in the center). You can hear my click on the video.

puz-ya commented 3 weeks ago

At PositionImage() variable zoomFac == 0.0f. Both translateX, translateY become "Infinity".