display JPG image on the form

  • Thread starter Thread starter dorji dukpa
  • Start date Start date
D

dorji dukpa

i want to store and display JPG images through a bound OLE
object frame. but when i insert an image, it can display
only an icon and the name of the file instead o fits
contents. however i have no problem with BMP files.

can anyone help me out?

thanks in advance,


Dorji Dukpa
 
dorji dukpa said:
i want to store and display JPG images through a bound OLE
object frame. but when i insert an image, it can display
only an icon and the name of the file instead o fits
contents. however i have no problem with BMP files.

First, I suggest that you do not store images in your database. It will
bloat it tremendously. Even if you are able to design it so that it bloats
only slightly, (and that's only possible with a significant amount of
coding) the images still present the same problems as other OLE fields.
(i.e. there is a greater chance of corruption). I suggest you use an image
control instead, and load images "on-the-fly" as needed. One possible
solution is the code in my sample PictureMgr database:

http://www.datastrat.com/Download/Picture2K.zip

Now, if you still need to get your images to display, you will need to
register an OLE server for your application. MS Paint is an OLE server for
bmp's and it may work for you with jpg's. Open up a Windows Explorer window
and go to Tools ... Folder Options ... File Types then associate the JPG
file type with a registered OLE server like Paint.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
Use the Image Control instead of an Object Frame control.
If your pictures are all the same dimensions, use a sample
picture to size the frame around it. If your pictures are
of different dimensions, make your frame square and set
the Picture Alignment property to "top left". In this
case, there will be a certain amount of dead space at the
bottom or right depending upon the dimensions of each
picture. Then set the following properties of the Image
control:
Picture - "(none)"
SizeMode - Zoom
Picture Type - Embedded
Picture Alignment - [see above]
Picture Tiling - No

Depending upon the coding, the table will have a text
field (not an OLE field) that holds the file name or
complete path to each picture. Check the Northwind sample
database for version 2002, where they have switched to the
Image control in their Employees form.
 
Back
Top