Use a web browser to view images

Zigzag

Registered User.
Local time
Today, 06:51
Joined
Aug 19, 2007
Messages
386
I have been playing around with displaying images on forms by using a web browser instead of using images. As we all know embedding images into a database has a tendency to bloat the db so the usual approach is to store the path and then load the images when required (This can still be slow if a 3meg images is being pulled over the network) or follow hyperlink when the path is clicked (This does not allow the image to be seen until the hyperlink is followed)

This demo application will create a shortcut of selected images and then display the folder where the shortcuts has been stored within a web browser.

Although the pictures are only thumbnail size I think the result are quite effective and the performance does not suffer even when there are many images.

It would be nice to get click events on the web browser to feed the info of the selected image back so that image could then be loaded onto the form, but as it is a double click opens the image in its native program.

I have never seen this approach suggested before and thought it would be useful for other members.

Access 2003
OS WinXP

Garry
 

Attachments

Last edited:
It you are using Access 2007 and probably some earlier you can show images with your data referentially. I started with Access 97 and used dbpix because there was not the facility about except OLE (Object as Large as Elephants).

There are three steps:

1) Declare the physical path of the Images Directory
2) Unique record to identify the image + file type [.jpg]
3) Concatenate the two to create the full file name

Then introduce the image via an unbound control with the forms on Current.

Tip.

Test if the file is there with the Dir command and set the image Visible = False if not and conversely Visible = True if it is present.

Simon
 
Hi Simon

I like the look of dbpix but thought it would be nice to show an example whithout using 3rd party software.

Garry
 
What Simon is suggesting does not require a external App

1) Declare the physical path of the Images Directory
2) Unique record to identify the image + file type [.jpg]
3) Concatenate the two to create the full file name

Then introduce the image via an unbound control with the forms on Current.
And will work
As for the browser - Theoretically you would be able to get the click - however I would go with Simons setup - as a browser is also dependant on things like "show pictures" set in the IE settings
 
I started with Access 97 and used dbpix
dbpix is a 3rd party app.

I have created apps that use the unbound method and the tecnique works well until the client / customer wants more than 1 picture per record and so you then start to introduce 2 smaller images (using the unbound method), 1 as the preview to the next image and 1 for the previously viewed image. If each image is 2.5meg then 7.5meg of images are being pulled across a network and things start to slow up.

Most of the time the operator does not want to see the image in all its glory just a preview, as long as there is the option to select the image and view it in full detail.

as a browser is also dependant on things like "show pictures" set in the IE settings

The browser is not dependant on any IE setting, it is dependant on the Customize setting of the folder the web browser is displaying.

If I have to display more than 1 image on a form this is the method that I use.


Theoretically you would be able to get the click

Where would I start looking to get the syntax for doing this?
 
Last edited:
2.5 and 7.5MB are far to large and I would consider to be immediate sizes images. If you consider that a screen is about 1000 pixel and then consider how big your object unbound image on the screen then you should be looking at:

max 500 pixel images high or wide
Low res about 60%-80%
File sizes of about 25-100KB

Simon
 
2.5 and 7.5MB are far to large and I would consider to be immediate sized images. If you consider that a screen is about 1000 pixel and then consider how big your object unbound image on the screen then you should be looking at:

max 500 pixel images high or wide
Low res about 60%-80%
File sizes of about 25-100KB

Simon
 
I might be wrong but in my experience the larger the Picture file you are using on a form the slower it takes to display. Even if your unbound image is no larger than a postage stamp it still takes the same amout of time to display as if the unbound image was full screen.

Like I said I could have it wrong!
 
You are entirely correct.

Size matters, I would add that 500 pixels maybe on the small size but remember:

1000 pixels is 4 times the size of a 500 pixel image.
2000 pixels is 8 times the size of a 500 pixel image.

I forgot to say the the images should be about 72 dpi and that you should hold images according to there size:

Masters any big image 50Mb+
Large any image 1MB
Images for low res less than 100KB

It is the images from the latter file you should use for everyday.

Simon
 
I can not control what size photo/images either bmp, jpeg, jpg etc etc the customer wishes to use which is why I came up with this tecnique.

The beauty of this is that the original image can be 10meg if they want to use it, the shortcut will create a nice little thumbnail for me that displays quickly. It also allows the original image to stay in its original location on the server while the shortcut can be stored where I want it to be.
 
Last edited:
Well I would tell your Client that whilst they can keep 10MB never, never use these other than reference files. You don't see 10MB files being rendered on web pages because if you have a 2Mbit download resulting in 256KB download it would 40 seconds to render the image.

I would suggest that the Client hives these file away and use low res images. I'm not saying that these files will corrupt the database but why should your system have to wait whilst images are being trasnsferred across the network and then to the screen.

Simon
 
I would suggest that the Client hives these file away and use low res images.

Thats exactly what this application is actualy doing automatically. It creates a thumbnail of the image and then displays the thumbnail via the web browser.
 
I don't understand why a web browser is used and why you are creating thumbnails.

The large files should not be accessed at all and to create a thumbnail is a such a doodle and takes seconds.

It you are using these thumbnails for the web, it is useful to have the img width and height so when the page renders the image aspect is defined and any text can be placed on the page correctly rather than the browser re-rendering the page once the img aspect has been obtained from the acutal image file.

Simon
 
Feel free to sugest an automated way (using access) of taking an images of any size/type and resizing them so that they can be displayed quickly on a form from several shared location on a network.

Out of curiosity have you actually opened the demo that I attached?
 
It's not Access job to resize images, that is the task of photoshop, although dbpix probably will do but the whole point of images is that they are an aid. I use photoshop to intercept images when these images need to fixed before they are published.

Simon
 
Example: An inventory database has (500 items), each item has images taken by the customer (ie the store man). There might only have 1 or it could have 5 images per item. The customer (store man) has taken these pictures and loaded them into a folder on either the local PC or a file server. He now wants to be able to preview these images on the form of his database next to all the details of the item.

The store man has no experience with Paint, Photoshop or any other photo editing software nor does he have the time to mess around with resizing photos, all he wants to do is for each item tell the database which images to view on the form.

This technique is designed to do just that without slowing the opening speed of the form.
 
I have just made a couple of changes to the example.
The option of viewing the images as Thmbnails or as a Filmstrip has been added.
 

Attachments

Users who are viewing this thread

Back
Top Bottom