saratoga
-
Posts
2 -
Joined
-
Last visited
Posts posted by saratoga
-
-
If I attempt to bring up the rotate layer dialog, I get an OverflowException if the canvas size is large enough. The error seems to happen when the total memory usage exceeds the 31 bit address space limit:
23170x23170 @ 4 bytes/pixel = 2^31 bytes = no crash
23171x23171 @ 4 bytes/pixel = 2^31 + 8 bytes = crash
Thanks!
Exception details:System.OverflowException: Overflow error.at System.Drawing.Graphics.CheckErrorStatus(Int32 status)at System.Drawing.Graphics.DrawImage(Image image, RectangleF destRect, RectangleF srcRect, GraphicsUnit srcUnit)at PaintDotNet.Controls.PanControl.DrawToGraphics(Graphics g) in d:\src\pdn\paintdotnet\src\PaintDotNet\Controls\PanControl.cs:line 368at PaintDotNet.Controls.PanControl.CheckRenderSurface() in d:\src\pdn\paintdotnet\src\PaintDotNet\Controls\PanControl.cs:line 258at PaintDotNet.Controls.PanControl.DoPaint(Graphics g) in d:\src\pdn\paintdotnet\src\PaintDotNet\Controls\PanControl.cs:line 266at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)at System.Windows.Forms.Control.WmEraseBkgnd(Message& m)at System.Windows.Forms.Control.WndProc(Message& m)at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Crash when rotating images with more than 2^29 pixels
in Troubleshooting & Bug Reports
Posted · Edited by saratoga
Assuming the rotate operation is backed by an array or similar data type, the solution may involve setting this option:
https://msdn.microsoft.com/en-us/library/hh285054(v=vs.110).aspx
This would extend the limit 4 fold to 2^31 pixels per image (~46,000x46,000) which is likely more than even I would need.