Help with Lebans Code - A2KAutosizeOLE

  • Thread starter Thread starter FinishRich2025
  • Start date Start date
F

FinishRich2025

http://www.lebans.com/autosizeole.htm

When I put my own BMP in the OLE object, the code doesn't return the
same height/width that is reported by windows.

I added a BMP that is 45 x 88 pixels.
When it displays, the program reports it as 60 x 117 pixels.

I am not sure where the difference is coming from.

If someone could download that database, test this theory and see if
it does it for them I would be greatly indebted.

Thanks,
FR
 
Hi FR,

Gave it a try. After solving the "OLE Server is not registered" problem to
finally get to load a bitmap into the Image table, things work as expected.
The bound object frame on the form resizes correctly to my image, and the
values for the image size are correct - as given via debug.print statements
wich I inserted into the code to get the values. These are the IWidth and
IHeight values in modOLEtAutoSize, prior to conversion to twips. If I look
at the IWidth and IHeight values in Sub AutoSizeOLE (the form's code), the
values there are all 15 times larger than the pixel size of the image; this
seems to be display dependent. I certainly don't see strange differences as
you report.

HTH,

Rob
 
I think the biggest issue is that it returns the size of the image
based solely on the screen DPI and not the actual image DPI. When I
put a 72dpi image in I get 72dpi, and when I put a 94dpi image in I
still get 72dpi... go figure. It just squishes/expands the image
depending on which direction the image dpi goes...

If anyone has another idea on how to get the image size from a OLE
embedded image in a table onto a report, I am game. I am just using
72dpi for now and resizing the bound object frame based on that.

Thanks,
FR
 
m:
If anyone has another idea on how to get the image size from a OLE
embedded image in a table onto a report, I am game. I am just
using 72dpi for now and resizing the bound object frame based on
that.

Image size and dpi are two very different things. PC screens are
96dpi (Macs 72), but that just determines how closely packed the
pixels are. The actual size of the image is going to be determined
by the number of pixels.
 
Back
Top