Programatically open bitmap and paste

schenel

New member
Local time
Today, 05:01
Joined
Nov 14, 2002
Messages
8
I have a form with a linked image control. The images are maps of rooms. The user needs to be able to paste images on the map of the room showing where air quality samples were taken.

What I need to be able to do is have a command button that will paste the image on the map after the user enters x,y coordinates or left,top coordinates and the image name to paste.

So I have a table that holds the id of the air sample, the id of the map, the X and Y coordinates and the name of the image.

Access needs to open the map and paste the image based on the coordinates in the table.

Anybody have any idea how I might do this??????

I assume I use a Shell() function or something like it to open the image file (a bitmap) but how do I paste the image at the coordinates specified???

Thanks,
I have a form with a linked image control. The images are maps of rooms. The user needs to be able to paste images on the map of the room showing where air quality samples were taken.

What I need to be able to do is have a command button that will paste the image on the map after the user enters x,y coordinates or left,top coordinates and the image name to paste.

So I have a table that holds the id of the air sample, the id of the map, the X and Y coordinates and the name of the image.

Access needs to open the map and paste the image based on the coordinates in the table.

Anybody have any idea how I might do this??????

I assume I use a Shell() function or something like it to open the image file (a bitmap) but how do I paste the image at the coordinates specified???

Thanks,

Ernie :confused:
 
I'm not 100% sure of what you want. Will the map need to be editable by the user (because you mention opening it in paint), else why not have a few image controls on the form, one for the main map & then create more at run-time & place them where needed over the map... You can (if accurate demensions are not important) enable drag & drop for the sample images...
 
Thanks for your post.

Well, the map needs to be editable as far as pasting a small image where the air quality sample was taken and a number with it. It would look something like the following:



However, you said "why not have a few image controls on the form, one for the main map & then create more at run-time & place them where needed over the map... "

How would you do this? Could I still use a table of data values and have the images load on the form at run-time?

I hadn't thought of doing this (well, I didn't realize it could be done).

Thanks,

Ernie
 
Schenel:

I don't know if this will help, but you can copy
an image to the clipboard with the following code:

Dim pic1 As String
pic1 = Me.image

RetVal = Shell("c:\Program Files\Common Files\Microsoft Shared\photoed\photoed.exe " & pic1, 3)
AppActivate RetVal, 0
SendKeys "%EC"
SendKeys "%(FX)", True

I am using Microsoft Photo Editor for this. You can use a different image editor. The image name in this example is pic1. I use it to paste an image into a merge document (Word).

.ActiveDocument.Bookmarks("Photo").Select
.Selection.Paste

Hope this helps.
 

Users who are viewing this thread

Back
Top Bottom