Zooming / Editing jpg images

E

Elaine K

I have successfully used an image control to display jpg images stored in a
location separate from my database. This works well, but in a few cases
there are both text and images stored in the jpg file (maybe a scan of an 8
1/2 x 11 page). The space available on my form for the image display is
limited so sometimes the resized image displays the text too small for the
user to read. Is it possible to use a control that will open the image in MS
Paint so that the text can be read or so that the image can be edited/cropped
etc. when this occurs? Will this impact the size of my database?
 
E

Elaine K

Hi Stephen;
I liked your idea about scrolling/zooming by inserting the image control on
a subform. I took a look at your website, but was unsure exactly where I
would find the info for doing this. Is it contained in one of the databases?
Is my idea of opening the paint program not do-able? I was thinking of
offering the capability of going into Excel for viewing/editing spreadsheets
at some point so I thought the code would be pretty much the same as for the
Paint stuff. I am concerned about the database size however, since I am
storing a lot of images.
Thanks
 
S

Stephen Lebans

Elaine the URL I posted points you to the LoadJpegGif MDB which contains the
Image control inserted onto a SubForm. Just have a look at this form in
Design view. If I remember correctly I simply created a Form to the max
allowed dimensions, inserted an Image control to the Max allowed dimensions
and that was it. Yes there is some code there to return to Scroll Positions
0,0 but that's it.

You cannot insert the Images as OLE objects if you have many images to work
with. Instead what you can do is simply call MS Paint with the name of the
current Image to be edited. If you can guarantee that MS Paint is the app
currently registered to display Bitmap files then you can simply do
something like:

Application.FollowHyperlink "PathToFolderofImages\NameOfImage.BMP"

or for more control:
http://www.mvps.org/access/api/api0018.htm
ShellExecuteA Application.hWndAccessApp, "open", sOutFile, vbNullString,
vbNullString, 1


If you cannot guarantee which app is currently registered to display the
desired Image type then you need to run the EXE and pass the name of the
File you want to have the app open. You can do this via the Shell command
exposed by the VBA library. This is a bit complicated as you will need to
find the path to the MS Paint EXE and then build a param string containing
the full path and filename of the Image you want to load into the app. There
is a somewhat ugly sample of how to do this in the ReportUtilities project
on my site. It shows how to use the API to resolve the full path to a given
EXE file and then build the required param string to pass to the Shell
command.

--

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

Elaine K

Thanks for your help Stephen. I like to keep it simple so I'll use the
subform approach.
 

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