Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pasting images

Status
Not open for further replies.

EdwardMartinIII

Technical User
Sep 17, 2002
1,655
US
I have a little Trouble Ticket database. It allows people to report issues with an application. At the moment, all descriptions are textual.

Users, however, are clamoring for a way to paste screenshots into the interface.

What I think will work is to have an "Include Image" button on my form. Hit the button and it opens a graphics sorta' pad, with an accompanying "Accept Image" button. CTRL-V to paste the screenshot, then "Accept Image" to accept the image. Then back to the form.

They may wish to include, oh, half a dozen or more screenshots, so my naming nomenclature will allow for a lot of images to be associated with a Trouble Ticket number.

On the form is a "Send this report!" button. Pressing that button writes the text data to the database and then somehow saves the image data to a predetermined directory as, say, a bitmap.

Is this even do-able in Access?

Edward
"Do not read this sentence."
 
Very simple; here's the minimum you need do:
'All names optional'

Create a table: provide two fields:
IndexID as Autonumber
ImageFile as OLEobject

Save the table: call it say, ImageGrab.

Now use the Wizard to create a Columnar form based on the table. In the OLEobject field set the image Size Mode to Zoom.

Open the form in View mode, press the PrintScreen button in the keyboard (left of Scroll Lock) now click on the OLE panel in the form, right click and select PASTE. Or use Ctl_V. Hey presto you have a copy of the image in the table. What you do with it I'll leave to your imagination.

Rod


 
Hi Rod,

Thanks for writing.

Hm, so that saves it as a part of the database, which is certainly one way of doing it. Can Access save the object as a separate file, a BMP or JPG or whatever? The thing is, each of the images files are going to be full-screen, which is about 3Meg. The database has been running only about 3 months and there's already more than 800 records in it, but it keeps its slim, shapely figure by accepting only text.

I'd much rather have a table of two text columns: TroubleTicketNumber and ImagePath, where ImagePath is simply a network path to a file associated with that TroubleTicket number.

Is that do-able?

Cheers,

Edward "Do not read this sentence."
 
Edward,

Yes you're right about that. I didn't think about it before, and of course if the picture is embeded inside an Access table you can't get at it easily from any other Image editing program.

I have two alternative ideas in mind but neither amount to a working solution at the moment.

Idea 1. Install a Kodak ImageEdit control into the form instead of the OLDObject control. You should have the Wang(Kodak) ImageEdit control in your list of ActiveX controls. This control has a SaveAs method and can handle a variety of image types.

So far I've installed a control on a form but I can't see how to make it display an image - duh!

Idea 2. Using the Wizard you can create a button to RUN an APPLICATION (RunApp) and in the command line insert the path to Microsoft Photo Editor. Easy so far and it opens Photo Editor on cue which allows any image in the clip-board to be pasted into a New Image and Saved.

Unlike the Kodak ActiveX control Photo Edit isn't inside the Access form so you can't address its features directly; or so it seems. Certainly I haven't found any way to control PhotoPaint using automation so far; IF ANYONE KNOWS HOW DO THAT please speak up.

This is a pity since using PhotoPaint's save option requires the user to coin a name for the image, whereas I would think you'd prefer the Access application to determine a logical/sequential name based on your own criteria.

This issue is almost certain to have been discussed here before but while the Search tool is unavailable we can't locate any previous threads. I'll let you know if I make any progress. Perhaps you'll do the same as I would like to see the solution develop.

Rod
 
Hi Rod,

I've been exploring the possibilities of using the Kodak controls, too, but I really can't seem to find much in the way of dox on them, so it's not quite as efficient as flailing around deep in the bone-filled Vale of Pnath while an enormous and unseen dhole hunts me stealthily, its leathery hide whispering against the remnants of long past ghoul feasting.

See the kind of weirdness I get to work under? 8)

I'm also trying to hammer out a save-a-file button, which means that if I can get people to save an image file on their hard drive, then I can maybe get the whole thing renamed and saved accordingly.

My dum-dum alternate is to pop up a window with detailed instructions on opening Photopaint, pasting a clipboard image there, and saving the file under a specified name in a specified network location. I guess that would be the stone-knives-and-bearskins approach to automation, right?

Yes, I would really like to automate this as much as possible, on the theory that the best user interface is no user interface.

One of our programmers (I'm just a tech writer, supposedly) learned about this assignment and laughed. It was a cold, humorless laugh...

I've set this thread to notify me and if I learn anything new today, I'll post to it.

Cheers,

Edward "Do not read this sentence."
 
meanwhile...

just to amplify my earlier notes try these examples as options for a command button click event:


Private Sub cmdKodak_Click()
On Error GoTo Err_cmdKodak_Click

Dim stAppName As String

stAppName = "C:\WINDOWS\KODAKIMG.EXE"
Call Shell(stAppName, 1)

Exit_cmdKodak_Click:
Exit Sub

Err_cmdKodak_Click:
MsgBox Err.Description
Resume Exit_cmdKodak_Click

End Sub

Private Sub cmdPaint_Click()
On Error GoTo Err_cmdPaint_Click

Dim stAppName As String

stAppName = "C:\WINDOWS\PBRUSH.EXE"
Call Shell(stAppName, 1)

Exit_cmdPaint_Click:
Exit Sub

Err_cmdPaint_Click:
MsgBox Err.Description
Resume Exit_cmdPaint_Click

End Sub

Private Sub cmdPhoto_Click()
On Error GoTo Err_cmdPhoto_Click

Dim stAppName As String

stAppName = "C:\Program Files\Common Files\Microsoft Shared\PhotoEd\PHOTOED.EXE"
Call Shell(stAppName, 1)

Exit_cmdPhoto_Click:
Exit Sub

Err_cmdPhoto_Click:
MsgBox Err.Description
Resume Exit_cmdPhoto_Click

End Sub


The progs may be in a different location on your machine of course but you get the idea I'm sure.

Photo Editor seems to be the best/easiest to use but people may be more familiar with the old standard; PaintBrush.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top