Attached is a Youtube video of an issue displaying a PNG in both the IDE and during runtime.
In the IDE, part of the image is shown vertically, and changes size when the Window is scrolled. Running the program and load a PNG shows the image at about 1/4 of the size.
What is your goal? ImageViewer is a terrible name in my opinion, because it’s an input control. It should have remained ImageWell in my opinion. Whatever the name, it should only be used for indicating to your user, “Yes, please drag and drop an image here.”
I can’t explain the inconsistencies you’re seeing on Windows. I definitely think it’s at least a couple of bug reports.
Circling back, if your only goal is to display an image then I wholly recommend you use a canvas. Canvas offers more control over everything as well.
I hope my tangent doesn’t offend, I’m sorry I don’t have any solutions for your actual problem
Apart from the scrolling/display issue in the IDE, in your running app it seems that it‘s due to the DPI settings of the picture. The picture you importet in Xojo is shown with 72 dpi; you assigned it. But if you load the picture by code the dpi real dpi settings stored with the picture will be used. I guess it‘s not 72 dpi. Please check that.
I understand why the decision is made to stay at 72 dpi to help make it easier to program the Xojo IDE and executables.
Unfortunately, it makes it difficult when I work with declares, plugins, or any other sort of coding that defaults to Windows standards. Just more work-arounds when trying to program in Windows.