alter lebans code from form to report

A

auntboo

from a previous thread, I found information leading to S. Leban code for
passing the width and height of an image in a form to the bound object.
I have tried without much success to change the code to pass the width and
height from the field imagedimensions to the controls on a report for an
image box so to speak. The image box being located in the detailed section.
Any help for an aunt in distress.

auntboo
 
S

Stephen Lebans

You are mixing your terminology and have lost me completely.

OLE Frame control -> Image is loaded as an OLE object
Image control -> Image is set via the control's Picture property

Which control are you using? Are you trying to Autosize the picture on your
report?

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
A

auntboo

thanks for being there and sorry that I have lost you completely.
Does this help

Table
Field Data Type Ex
txtImageName text c:\mydocuments\2006-4.jpg
ImageDimensions text 250x350
ImageID autonumber

Report
Detail section
Name Control source or Picture
txtImageID ImageID
txtImageName txtimagename visible - no
ImageFrame c:\mydocuments\2006-4.jpg width tbd
height tbd
txtImageDimension imagedimension

With that being said, I found code that populates the ImageFrame with the
correct jpeg. from txtImageName. What I cannot do, but tried to do with code
from your website, is to modify so that the width and height dimensions of
the picture are passed to the image frame and that the actual size of the
image frame changes with each image and that no space is wasted.

I sure hope that this makes more sense. Please let me know if it does not.
 
S

Stephen Lebans

As I asked in my previous reply, are you usijng the Image control or the OLE
Frame control?

Here is a previous post of mine on this issue:

Generally your would not perform 'Autosizing" of the Image control
itself because of resolution issues. You see Access defaults to
displaying any Image at I believe 72DPI. So therefore to maintain the
original Image size you have to set the Image control to the original
Image dimensions and then set the Image control's SizeMode property to
ZOOM.

Remember, a lot of popular Image formats do not store their original
size or resolution within the file.


Finally, if you want to get what Access interprets as the Image
dimensions there are 2 Image control props available after an Image is
loaded. IMO these numbers are more valid for Metafiles, certain Jpegs
but you decide what works in your situation. Also you should add code to
handle situations when these numbers are ZERO or not valid as I have
seen cases of both!


' Load and image into the Image control
Me.YourImageControl.SizeMode = acOLESizeZoom
Me.YourImageControl.Picture = "C:\somefile.jpg"
Me.YourImageControl.Width = YourImageControl.ImageWidth
Me.YourImageControl.Height = YourImageControl.ImageHeight

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top