I have an application that uses Windows.Forms.Panel to display a list of pictures. When the height of the panel exceeds 32767 pixels the rest of the content is simply cut off.
example:
Windows.Forms.Panel myPanel;
ArrayList pictureList;
foreach(pic in pictureList) {
myPanel.Controls.Add(pic) // adds all the objects without complaints
}
In the example all elements are add to the panel without an error to be thrown, but after the panel has reached a size of 32767 no image is displayed anymore.
My question: Is it possible to break this limit and display more content in a panel?
I know that the approach is inconvinient in any way, but there is no time now to redesign the whole Application.
This is an architectural limitation in Windows. Various messages that indicate positions in a window, like WM_MOUSEMOVE, report the position in a 32-bit integer with 16-bits for the X and 16-bits for the Y-position. You therefore cannot create a window that’s larger than short.MaxValue. This isn’t exactly a real problem, nobody has a monitor that’s wider than 32,767 pixels and won’t for a long time to come.
You’ll have to do this differently. Like using Graphics.TranslateTransform() in a Paint method.