<ch*******@hotmail.com> wrote
I've put the following code into the
'On Format' event in the 'Detail'
section of the report.
imgPicture.Height = imgPicture.ImageHeight
imgPicture.width = imgPicture.ImageWidth
What happens is that it checks the dimensions
of the first image and uses that size control
for all the images regardless of the size. Do
you have any suggestions on how to improve it?
For a quick test, I modified the experimental report that I had done to test
resetting the Detail Section height. It was based on the Northwind.MDB
Categories Table, which has imbedded OLE Object Pictures. I was able to
expand and contract the height of a Bound OLE Frame with the Pictures
inside. I made corresponding changes to the height of the Detail Section,
which worked, also.
I'd expect if changing height and width worked for a Bound OLE Frame, that
it would also work for an Image Control -- but what i expect doesn't always
prove true.
It is possible, perhaps, that the "ImageHeight" and "ImageWidth" properties
are affected by the Control's "Height" and "Width" properties, so may not be
a good choice for this purpose.
Just remember that Height and Width for Reports are in units of "twips", or
1/1,440th of an inch, so if you are storing picture height and width in
inches, multiply by 1440 before using to manipulate controls.
Larry Linson
Microsoft Access MVP