Insert photos into Access Forms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can someone please give me a step by step? sizing them (shrinking) and
everything?
I'm struggling, I have photos in *.jpg
In the Northwinds sample database "employees field" they have them stored as
text!?
HELP!
 
Hi Ribcage

Are you sure you want to "insert" (embedd) insead of "linking" - see Offer's
answer.

If you do want to "insert" then instead of using a JPEG you would be much
better to using wmf (Windows Meta File) format for access OLE fields. If you
only have a few pictures you can embed them but if you have many (to reduce
the d base size) try linking them - (either use Offer's answer or use the
link file on the properties box on form design

The method shown on the MS website (see Offer's answer) is to "link"
pictures but if you really want to embed your pictures (remember that this
will enlarge the file size of your DB).

Make copies of the pictures you want to link to your records (on C Drive /
hard disk) and save them as
ThumbnailPicture1,
ThumbnailPicture2,
ThumbnailPicture3,
etc, (or use the ID of the record in the table)

If you have a picture processing programme such as Photoshop or Photopaint
then use that to resample and convert. If you don’t have one of these
programmes:

1 Click start
2 Click My Pictures (if that’s where they are)
3 Right click the picture and select “Open Withâ€
4 Select Windows Office Picture Manager
5 After the picture is open click the Picture Menu then select Resize
6 Resize your picture to the correct size
NOTE. You will need to know the pixel size of your OLE box see below
7 SaveAS a copy of the original (DON’T JUST SAVE or you will ruin the
original picture)

WMF = Windows Metafile is the best option
BMP = Windows Bitmap is also a good option
GIFF CompuServe Bitmap is also OK
JPEG’s “will†work but they are not really meant for this type of application
TIFF’s are not supported by most access versions.

Create an OLE field in the table (use this OLE field on your form if you
wish to display the picture on a form with a particular record)


To link your picture thumbnail with the OLE
8 Open the Table that will hold the data /picture (not the form)
9 navigate to the OLE field on the correct record and Right Click
10 Select Insert Object
11 Select Create From File and then Bitmap and then check the Link option
12 Browse to your picture and select it
13 Click OK
14 “Package†will appear in the field
15 View your image on the form


Some notes on the size of your OLE object – regardless of what anyone will
tell you (and some answers on this forum ??) there is no way of converting
pixels to cm’s – which is what your OLE object will be sized in, UNLESS you
know the size of each pixel or even the screen resolution and as screens are
all different sizes and resolutions this simply isn’t possible here, so I
have given the APPROXIMATE conversions here you will have to gig about with
your thumbnail until it fits your OLE. Better still save all the thumbnails
as size that you’re happy with and resize your OLE to fit this.

On a screen resolution of 1024 Pixels X 768 (this is standard High Res for a
lap top)
5mm = 118 Pixels or 14.173 Points
1cm = 236 Pixels or 28.346 Points
So you can work out that say 3.5cm would be 827 Pixels or 99.213 Points

You can use Access to convert your pictures to a bitmap (using the insert
object action)

A common mistake is to placed uncompressed images into your D
Base. This is a common error so don’t worry if you have but the main thing
to remember about pictures (without at all getting technical) is that they
are BIG.

If your images were taken by a standard digital camera or scanner then you
will have a jpeg and if your pictures are at the moment 72dpi and 7.5mb then
each pictures is 73cm X 55cm which is too say the least too big. The same
picture resampled down to 2cm by 3cm “AND†converted to a bmp (bitmap) would
be only 1420kb (a standard 6inch by 4inch would be over 7mb).

So what you need to do is to compress and reduce the image size "to what you
need". The average size of OLE box in the forms I have made in the past is
around 2cm by 3cm. THIS IS ALL YOU NEED and (more importantly) you ONLY need
the images to be saved at 72dpi as you will not see and difference on your
screen at anything higher (unless you want to zoom in to the picture - which
is not to idea with OLE objects)

Hope this helps and points you in the right direction
 
I have an App w/ Unbound Controls.

As I populate each record, I have a textbox called ABCD & an Image Control.

The code snippet...From opening a Recordset for the PK for the Record..
...
ABCD = !APic ----> "APic" just stores th Path - IE...C:\BobDev\Bob5.jpg
Me!Image123.Picture = Me!ABCD

"Image123" is an Embedded Picture Type, Size Mode = Clip, Picture Alignment
= Center, Picture Tiling = No.

HTH - Bob
 
Can someone please give me a step by
step? sizing them (shrinking) and
everything? I'm struggling, I have
photos in *.jpg In the Northwinds sample
database "employees field" they have
them stored as text!?

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.

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
 
Hi Wayne:

I found your previous post about how to insert pictures to a form (linking
the picture to the database instead of embedding it), I followed the steps
you suggested but I still can't see the picture on the form. My guess is
that it has to do picture size and the OLE size, also I was told that instead
of "Package" on the table field I should see "Bitmap picture", does this have
anything to do"
 
Sara said:
I found your previous post about how to insert pictures to a form (linking
the picture to the database instead of embedding it), I followed the steps
you suggested but I still can't see the picture on the form. My guess is
that it has to do picture size and the OLE size, also I was told that
instead
of "Package" on the table field I should see "Bitmap picture", does this
have
anything to do"

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.

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
 
Thanks for your reply.

I am trying to display bound pictures in a form. I decided to go with the
OLE version because this is a small datbase, however I am having trouble
displaying the pictures. I am using Access 2003, the article you sent me is
based on other versions of Access I tied to follow the suggestions withour
results, Is there anything else I need to know about the 2003 version?
The controls on my form display an icon representing the OLE imaging
application, and only when double clicked, they open the application in
full-screen view.
The article talks about this problem in Access 97, but I am using 2003.
Also, regardless of the version, It didn't seem clear to me how to fix this.
Do I need additional software?
 
Sara said:
Thanks for your reply.

I am trying to display bound pictures in a form. I decided to go with the
OLE version because this is a small datbase, however I am having trouble
displaying the pictures. I am using Access 2003, the article you sent me is
based on other versions of Access I tied to follow the suggestions withour
results, Is there anything else I need to know about the 2003 version?
The controls on my form display an icon representing the OLE imaging
application, and only when double clicked, they open the application in
full-screen view.
The article talks about this problem in Access 97, but I am using 2003.
Also, regardless of the version, It didn't seem clear to me how to fix this.
Do I need additional software?

Did you attempt to execute the sample/example application? The article is
just explanatory, and the intent was to provide both information and a
sample application. The example application, in Access 2000 file format,
runs just fine for me under Access 2003, and in the OLE part of the example,
displays the picture in the Bound OLE Frame. Since that is the case, I've
not seen any need to update either the verbiage or the example for Access
2002 or 2003. As there are changes in Access 2007, when conditions permit, I
will be updating for Access 2007.

If you open the sample application, look at frmImageOLEDetail, right-click
the Bound Object Frame, oleTheImage, and display Properties, choose the Data
or All tabs, and look at Display Type, it should read "Content", not "Icon".
If it does read "Content", then you have a problem with the image software
you have registered for the image file type. You probably do not want to
change the registration, if you are happy with your image-processing
software, but AFAIK, Internet Explorer v. 6 or v. 7, will display .GIF or
..JPG files in the Bound Object Frame.

Even without the problem of "bloat", you still have "put yourself at the
mercy" of whatever image software is registered for the image file type on
the user's (you, of course, may be the user) machine.

Larry Linson
Microsoft Access MVP
 

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

Back
Top