Linking a picture

G

Guest

I've read many posts about linking pictures to a DB but most of them have to
deal with different pictures for different records. If I just wanted to put
our company logo on my form and not tie it to any records or anything like
that would I just link the pictures to a file and just choose "Linked" in the
properties and then point to the location? Is it this simple for what I'm
trying to do?
 
G

Guest

Hi Secret Squirrel,

Use the Image control from the toolbox. If you have the control wizards
activated, then it will create an embedded picture, by default, thus bloating
your database. You can change this to linked on the Format tab of the
Properties dialog for the image control. Then do a compact and repair to
recover from the bloat.

I was able to link a couple of nice photos using this technique, and the
database grew (after compacting) by only 4 KB in size (98,304 bytes final-
94,208 bytes initial).


Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
 
J

JK

In design view through the menu:

Insert->picture
Then select the picture file, bring it in, position it, resize it if
necessary and bingo

(the default picture type in properties is "embedded", you can link it if
you wish but I would not recommend it)

Regards/JK
 
J

JK

Hi Tom,

1. To tell the truth, I have never thought about it (although I use
embedded logos of 5 to 25K ) so I ran some tests on an empty form in an
existing database:

test 1 : jpg picture 422 K
Before inserting 24,392 K
After inserting 29,460 K (Wow!!!!!!) embedded
24,448 K linked

Test 2 bmp Graphics (my letterhead) 113 K
before inserting 24,388 K
after inserting 24,520 K embedded
24,392 K linked

(I guess that Access handles BMP better or the blotting is exponential to
the size (or both)

2. For permanent images such as logo I don't like linking because the file
can be renamed, moved or deleted. When I need to change image such as in
your example, there is no other choice but to link in some way, I do it
myself either by changing the image and keeping the file name or having the
file name/Location in the user file with an appropriate OnOpen
procedure/function, depending on the circumstances.

Regards/JK
 
G

Guest

Not that I want to contradict what you are saying about using bmp files
instead but I have the same picture, one as a bmp, and one as a jpeg. The bmp
is 214kb and the jpeg is 26kb. How can using a bmp keep the size of your db
to a minimum in this case?
 
G

Guest

Hi Tom,

My only concern about linking this logo is that I do my enhancements on my
home pc and the db sits on the server at work. Every time I upload the new db
I will have to change the links to point to somewhere on the server. I assume
that maybe there is an easier way to do this?

SS
 
G

Guest

Hi JK,

The increase in file size that you witnessed for the 422 KB embedded .jpg
file, 5068 KB (= 4.95 MB approx.) is due to the method that Access uses to
embed images. My understanding is that images get converted internally to
..bmp format. Apparently the next version of Access, currently in beta
release, has finally solved this problem. You can read more about it at this
link:

http://blogs.msdn.com/access/archive/2005/11/07/490113.aspx

which includes the following quote: "Modern image support - use png, gif,
jpg, etc without database bloat and maintain transparency."

Your 113 KB letterhead .bmp file was already in the .bmp file format, so the
resulting 132 KB growth is much more reasonable by comparison. The bloating
is certainly proportional to the resolution and file type of the source image.
2. For permanent images such as logo I don't like linking because the file
can be renamed, moved or deleted.

I volunteered the linking, since the OP included the word linking in his
original post. I have not yet investigated if it is possible to set the
linked path at run-time. If it is, then this could help with the issue that
he mentions in the follow-on post (8:46 AM PST): "I do my enhancements on my
home pc and the db sits on the server at work." Certainly embedding is
easier, and you're always guaranteed to have the file available, as long as
you are willing to deal with any bloat issues.


Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
 
G

Guest

L

Larry Linson

Not that I want to contradict what you
are saying about using bmp files instead
but I have the same picture, one as a bmp,
and one as a jpeg. The bmp is 214kb and
the jpeg is 26kb. How can using a bmp
keep the size of your db to a minimum
in this case?

Because if you embed a JPG, or even link one to an OLE Object, Access and
the Com-enabled Graphics program registered for JPG will _create_ and store
a bitmap "thumbnail" which will be many times as large as the JPG, along
with the JPG. That may not be a BMP, but a device-independent-bitmap file.
In any case, it's not stored so that you can access it, just Access. See
the article in the image sample download at http://accdevel.tripod.com for
additional explanation.

Use a BMP and embed for the most efficient embedded image. And, given that
an Access database can be as large as 2GB since Access 2000, one or two
embedded images on Forms or Reports aren't likely to drive you up the wall.
They'll be in the front-end, anyway, which should be split from the Tables
and data as a matter of good practice for production databases.

Embedding lots of JPGs in OLE Objects in the back end, however, would be
another story.

Larry Linson
Microsoft Access MVP
 
G

Guest

Hi Tom,
What I've decided to do was limit the amount of times I have my logo on my
forms. This will decrease the size of the db. I guess it was kind of overkill
to have it on every menu form. I appreciate your help and comments.

Thanks again!
SS
 
G

Guest

Hi SS,

You can certainly have it on every form, without suffering additional bloat.
Just embed the image into one form. Then add a subform (and subreport)
control to every form and report that you want to display your logo. Set the
Source Object for the subform control to your new form that includes the
embedded image. The image is embedded only one time, but can be used on any
number of forms and reports.


Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
 
G

Guest

Now there's a thought! So what you're saying is create a separate form with
just my logo on it and then create a subform for every form I want to put it
 
G

Guest

...and then create a subform for every form I want to put it on...

Yes. Create a subform container for every form that you want to put it on.
I'd deactivate the control wizard for this operation, so that the wizard does
not activate. Then set the Source Object to your form that contains the
embedded image. You might want to set the border style to transparent for the
subform/subreport container.

The beauty of using this technique is that if you want to change the logo at
a later date, you only need to change it in one form.


Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
 
G

Guest

I'm no genious, but I am glad I could help!

Oh, you might want to experiment with setting the Can Grow and Can Shrink
properties to Yes for the control on your forms and reports that holds your
logo form. That way, if you later change the logo, the vertical size should
adjust automatically (I think) if a new logo is slightly taller or shorter
than the logo you initially used. Can Grow and Can Shrink will not help with
changes in the width. It would be best if you sized any replacement logo to
exactly the same size as the original image.


Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
 
G

Guest

I will keep that in mind. Thanks again!

Tom Wickerath said:
I'm no genious, but I am glad I could help!

Oh, you might want to experiment with setting the Can Grow and Can Shrink
properties to Yes for the control on your forms and reports that holds your
logo form. That way, if you later change the logo, the vertical size should
adjust automatically (I think) if a new logo is slightly taller or shorter
than the logo you initially used. Can Grow and Can Shrink will not help with
changes in the width. It would be best if you sized any replacement logo to
exactly the same size as the original image.


Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
 
G

Guest

Hi Tom,
I just got done changing everything over and I saved 20MB by doing it that
way. That really made a big difference!!!
Thanks Again
SS
 
G

Guest

Hi Tom,
Well I ran into a problem using this method of creating a subform for my
logo. Not sure I understand this one. Since I created 2 separate forms for my
two logos and created subforms on each of my forms to show the logo every
time I log into the database it puts me in exclusive mode and nobody else can
log in unless I log out. Does this seem strange to you? If I open up the
database without the logo subforms on my main switchboard it works ok but
once I go to another form that has them and then go back to the main
switchboard it puts me back into exclusive mode. And this only seems to
happen to me and none of my other users. Any idea what might be causing this?

SS
 

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

Similar Threads


Top