How can I display a jpg file on an Access form?

G

Guest

I have a db of photos. I currently display a thumbnail of each photo with a
link to a folder with the compressed (jpg) thumbnails, but because the data
is on the server this creates a great deal of traffic. This works but
considering that the thumbnail is only 2 or 3k (jpg) I would like to embed
the thumbnail in the photo table as an OLE Object. This only displays an
icon. If I embed a bmp (20k) it works, but now I have a size problem. My
question is, can I display an embedded jpg on a form? Also, can I use code
to write the jpgs from the folder to the db?
 
L

Larry Linson

I have a db of photos. I currently display
a thumbnail of each photo with a link to a
folder with the compressed (jpg) thumbnails,
but because the data is on the server this
creates a great deal of traffic. This works but
considering that the thumbnail is only 2 or 3k
(jpg) I would like to embed the thumbnail in
the photo table as an OLE Object. This only
displays an icon. If I embed a bmp (20k) it
works, but now I have a size problem. My
question is, can I display an embedded jpg
on a form? Also, can I use code
to write the jpgs from the folder to the db?

The sample imaging databases at http://accdevel.tripod.com illustrate three
approaches to handling images in Access, and the download includes an
article discussing considerations in choosing an approach. Two of the
approaches do not use OLE Objects and, thus, avoid the database bloat, and
some other problems, associated with images in OLE Objects. You may be sorry
if you try to use OLE Objects to store your own version of thumbnail.
Access, Jet, and the imaging software registered for the filetype will be
employed to create a bitmap thumbnail that will be many, many times as large
as your compressed file.

If you are printing the images in reports, to avoid memory leakage, you
should also see MVP Stephen Lebans' http://www.lebans.com/printfailures.htm.
PrintFailure.zip is an Access97 MDB containing a report that fails during
the Access formatting process prior to being spooled to the Printer Driver.
This MDB also contains code showing how to convert the contents of the Image
control to a Bitmap file prior to printing. This helps alleviate the "Out of
Memory" error that can popup when printing image intensive reports.

Larry Linson
Microsoft Access MVP
 
B

bob

The reason the images display as an Icon is because you do not have a suitable OLE Server application installed.
Note that Access 2003 does not include (and will in fact remove) the typical OLE server application, MS
Photo Editor.

If you do store the JPEGs using OLE Embedding they will typically still be larger than the equivalent bmp's,
because OLE Embedding stores an additional uncompressed 'preview' image - for very highly compressed JPEGs
the overhead can be up to 200 *times* the original filesize. You can store the JPEGs using raw binary
(blob) storage without any overhead, but displaying them typically requires quite some coding and external
dependencies, or third party components, since Access itself has no native JPEG decoding/display capabilities.


Ideally you should use interpolation/resampling to create your thumbnails, and strip EXIF data (especially
EXIF thumbnails) to minimize the size.

Additional info on OLE Embedding problems, solutions and alternatives is available here:
http://www.ammara.com/articles/accesspictureole.html
 

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