Efficient image use.

S

Sean

Hi all,
I have an MDB with about 500 forms each of which have a subform attached in
the top right with our logo on it.
The logo subform just has an Unbound Object Frame on it with an embedded
bitmap.

This works fine under 97. My problem is with Access XP. Under XP, when
developing, if I put a form (that has the logo subform on it) into design
view all the other forms with the logo subform on it close down. As
developers, you can understand that this isn't acceptable at all when
stepping thru code as some forms refer to allready loaded forms (which have
shut down), --- this didn't happen in 97.

So what I want to do is change from putting the logo subform on the forms to
putting an "image" on the forms.

Our app is often deployed on Terminal servers so I don't really want to LOAD
A PICTURE FROM A FILE each time a form loads..

What I'd like to know is, can I load a picture ONCE into memory and then
refer to it in my other forms?????????

Any advice or experience would be greatly appreciated.
 
S

Stephen Lebans

There's several methods available but the simplest for you might be to:

1) Embed the logo within an Image control(not an OLE Frame control) on a
Form that will always be open while your app is running. YOu can open a
form and leave it invisible if you need to.

2) From each Form's Load event that you open do something like:
Me.NewFormOpening.NameOFImageCOntrolForLogo.PictureData =
Forms!FormALwaysOpen.NameOfImageControl.PictureData.

--

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

Dave Ruhl

Just a question (as I'm sure I can't improve on Stephan's
answer) - Is it inefficient to use Linked images ? I use
about 5 very small images on each of my 50 forms. They
are used in place of command buttons and I link them
wherever they are needed. Will my forms load faster if I
use your method Stephan ?
 
S

Stephen Lebans

Why Link them in the first place? Especially if you are using the Images
in more than one control!
The two methods I use are:

1) As explained in my previous post, with only a few images, simple
embed them directly within an Image control on a Form that you will keep
open during the entire session. Copy the PictureData prop from the
master Image control to whatver control you need to. The PictureData
prop is exposed for all controls that can contain an Image with the
exception of the OLE Framce controls.

2) If you want to completely hide the stored images from your users
then:
a) Open the form containing the controls that have the embedded
Images(Image, CommandButton etc.)
b) Copy the PictureData prop to a Long Binary Field
c) Now whenever you need the Image data simply copy it from the table
into the PictureData prop of the control.

--

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