Problem with image on form

  • Thread starter Thread starter Richardson
  • Start date Start date
R

Richardson

I have a switchboard where I want a company image. It will appear only on
the one form. The file is a 129k jpeg. I know that inserting images in
Access tends to cause bloat, but adding this image increases my file size by
9 meg even after compacting.
I would prefer to have the image embedded, but due to the size I tried
making it a link.
However, I tried running the database with Access runtime on a Windows 2000
machine and it was unable to recognize the image files on the form.
It was create on Office XP developer.
Does anyone have a suggestion on how to get around these problems?

Thanks in advance,
Lori
 
Here is a previous post of mine on this issue:

From: Stephen Lebans ([email protected])
Subject: Re: Embedding graphics in an OLE field


View this article only
Newsgroups: microsoft.public.access.formscoding
Date: 2003-07-24 05:10:18 PST


DO you want to store the Images externally of the Form because you will
be using the "toggle button images" on more than 1 form or for multiple
controls?
If not then simply embedd the Images directly in two Image controls and
make then visible/invisible as required.

If multiple instances will be required then you have a couple of
options:

1) You can reference the PictureData property of the control as long as
the Form is open. For example:
Form2.ImageControSlave.PictureData =
Form1.ImageControMaster1.PictureData
or
2) Copy the PictureData prop of the two master Image controls to your
long binary OLE field.
Assuming a binary field(not control name!) named "Binary" then use code
like:
Me.Binary = Me.ImageControMaster1.PictureData
or
3) COpy the contents of the original image file(s) as is directly into
your long binary OLE field.
a) Read the entire file into a byte array
b) Copy the byte array into the binary field
WHen you need the image data you would have to:
c) Copy the contents of the binary field out to a temp disk file
d) Load the temp disk file into the Picture prop of the Image control


I prefer option #2.



--

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