edit image and save

brickelldb

Registered User.
Local time
Today, 09:28
Joined
Mar 9, 2009
Messages
70
The user views a record via form. This record has an image which they view on that form. I would like the user to edit that image (draw a line or a circle on that image) and save it back to the database - and would like for all of this to happen within the access db project.

CAN ANYONE HELP?? :confused:
 
Don't.

This is a database application not a image editor.
General rule don't let user change images.
Use Photoshop or Photoshop Elements.

My application handles over 17,000 images, changes to images are may outside the database. I accept that there are limitations to databases and accept that image manipulation is better by a specialist application.

Simon
 
Simon - thanks for your reply! I do understand where you are coming from - However, the problem is that editing this particular image is 1 key element of the function of this "application. They check boxes, enter information and draw the size of a "scratch" on the image. Every record uses this exact same "base" image and then the user needs to draw a scratch on the image. Anyone have any ideas? Should I be looking towards another method of development?
 
Why do they draw a scratch, what does it signify?

Simon
 
It signifies the size of the damage on a wall they inspect. they may need to draw a line or a circle depending on the damage they inspect.

Am i chasing a pipe dream? Should I just move on to another development tool that will let me use controls to do this or does Access have one available. I'm not looking to do the changes with an outside program. I need this functionality and I need it to be done within the app.
 
you may be able to do this with a something resembling vectors. i once used (not created) a database which placed letters on an image (a static image of a body, which was same for each individual - very much like your wall) depending on which muscle you chose, and then would save that info and/or pass that info to a report. when i dug deeper the muscles were pre-indexed with pixel position for the image (this particular DB actually had several images 'indexed' with muscles) - but i don't know how they went about applying the indexing to the image. (i looked as though the letters were superimposed over the image, and each individual record could have different combination of letters, all placed where they were supposed to be in relation to which muscle they represented)

i have NO idea if vector LINES can be drawn in access, but maybe do a search via google on the topic... maybe you might be able to make a novel application/use for them in access? how awesome would that be!

edit: when i say 'indexed' i mean coordinates and (as far as i can remember) they had a table with a column for X axis and a column for Y axis... so basically, you can enter your OWN co-ordinates, and i don't see why you wouldn't be able to make a mouse-click for it...
 
Last edited:
I have an application written in VB that does what you want. It does it in its simplest terms and uses images editable in Paint. I do not have an Access version but here is a support document to show you the functionality.

David
 

Attachments

Aaahh you guys are the best. Great response - thank you for examples (wiklendt & Dcrake). The help was greatly appreciated!!!!!!!!!!!!!!!!!
 
Last edited:
DCrake - would you mind sharing the code for how you did what your documentation sheet that you shared explains?

Where a record starts with a default image....then being allowed to open it and edit....then saving back for that record? And the circle of life continuing for each new record.....

THANKS, MUCH APPRECIATED.
 
Here is a mock up of what you want.

The demo needs a default bitmap (Default.bmp) to be in your CurrentProject.Path \Images\

So whereever you save this demo create a sub foelder named images and place the default.bmp in that folder.

David
 

Attachments

So I have it working. I have my form pulling the default image, and pulls in the 00001.bmp in if it exists, otherwise it pulls in the default image.

As for the edit button....I created a button and input the code per your example. However, when i press the edit button, it gives me the error "File Not Found"

I named image control: Img1 and the command button: CmdEdit as per your example as well...I looked through code and double checked everything but everything seems identical...

This is the code for the form....

Private Sub Form_Load()
ShellApplication = "msPaint.exe" 'Shell file
AppPath = CurrentProject.Path & "\Images\" 'Where the images are located
strFileToOpen = "Default.bmp" 'Blank image
strFileToSave = "00001.bmp" 'Coloured in image
sFile = AppPath & strFileToSave

If Dir(sFile) = "" Then
FileSystem.FileCopy AppPath & strFileToOpen, sFile
DoEvents
End If

Me.Img1.Picture = sFile
End Sub

This is the code for the button...

Private Sub CmdEdit_Click()
On Error GoTo Err_CmdEdit_Click
Dim RetVal
RetVal = Shell(ShellApplication & " " & Chr(34) & sFile, vbNormalFocus)
Exit_CmdEdit_Click:
Exit Sub
Err_CmdEdit_Click:
MsgBox Err.Description
Resume Exit_CmdEdit_Click
End Sub
 
After looking some more I figured out where I messed up.

Now I need to link to my records.

Thanks again for your help! Much appreciated.
 

Users who are viewing this thread

Back
Top Bottom