Still at it said:
Wonder if your're seeing this thread still?
I tend to keep threads for about 2 wks before deleting so still here!
Is it possible to 'auto-zoom' to a set size first.
Some good stuff here to read image size from file, "File Info" section
http://edais.mvps.org/Code/Libraries/index.html
You might find this a little daunting and not sure necessary for your
purposes (you'd need to know how to implement 'Class', the examples are
intended to drop straight into a VB6 project though at a glance I expect
would work with minimal modification in VBA).
But I think all you need to do is load the picture to its default size as
you've been doing then compare image width (X) & height (Y) with your
default dimensions. If either X or Y is too big/small, calculate the factor
of both differences and resize the picture by the largest factor. Perhaps
you might have default min & max dim's and only adjust if either X or Y is
too small/big.
As I think I mentioned before you can either use the Zoom method or rescale
the dimensions of the image. With the rescale method you might need to
change image properties Autosize True (on load) <> false (after loading) and
possibly PictureSizeMode (not saying you will, I haven't tested).
The above would be pretty much the same as the code you are already using
for user to resize (zoom) the image except you do this on loading the image
(if necessary). You'd just need to store the resize factor as the current
zoom setting.
Regards,
Peter T