[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Access 2013 - Image Field - Double Click to enlarge and edit

Posted on 2013-12-06
6
Medium Priority
?
2,312 Views
Last Modified: 2013-12-12
Access 2013 Database

I have a form that assigns a picture to an image field and I'd like to be  able to double click the image field and see an enlarged copy of the photo and then when I close have the option to save the image with any edits I might make

Is this possible? If so please help me get started with the process

Thanks
0
Comment
Question by:rogerdjr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 21
ID: 39702822
Is this possible?
Maybe ...

What image editor software will you be using?  Does it support automation?

*** Note: Every computer that will run your database and need to edit images will have to have the image editing software installed.

What is built-in

See: http://office.microsoft.com/en-us/access-help/use-images-in-your-access-forms-reports-and-controls-HA001147204.aspx#BMupdatelinks
Edit images from within Access

If the computer that runs your database has the graphics program used to create your images, and that graphics program supports being started from within Access, you can edit images directly from your form. If you aren't sure whether your graphics program supports that functionality, the best way to find out is to follow the steps in these sections and try to edit a bound or unbound image.

 Note   If you're editing embedded images, these steps only change one instance of the image. These steps do not change the original image. Also, if you embed an image more than once, you must change each instance of the embedded file.

Custom Solutions

You could write custom VBA code to do it if your have an image editor that supports automation.

Steps:
1) write the image out to a (temp) file
2) launch the editor
3) check to see if the file have changed
4) If changed then:
- 4a) delete the original image
- 4b) insert the updated image
5) delete the temp images.


There are third-party controls you can purchase that will do this.

Check out:

1) GdPicture

http://www.gdpicture.com/solutions/Image-Processing.php

GdPicture.NET series of toolkits and plugins provide both .NET and ActiveX controls so , besides .NET platforms, you can use it in many other different platforms such as HTML page, SilverLight app., Visual FoxPro, Delphi, VB6, MSAccess and all other IDE supporting ActiveX.


Main Features

    Resize and Scale an image using nine different interpolation algorithms.
    Create HQ thumbnails.
    Image filters include Per Pixel Filters, Convulsion Filters, Edge Detection Filters, Bilinear Filters and Displacement Filters.
    Effects and Filters include Median, Gaussian,Unsharp Mask, Despeckle, FloodFill, Red-eye removal, Emboss, Sharpen, Blur, Edge Detection,Twirl, Chroma Key Background Removal…
    Color anti-aliasing and smoothing.
    Scale a bitonal bitmap to a gray bitmap.
    Advanced image-merging support.
    Area and region processing.
    Standard rotations: 90°, 180°, 270°.
    Mirror, flip and invert an image.
    Angle rotation with 1/1000 degree increments.
    Adjust contrast, brightness, gamma and saturation.
    Bitonal Image Enhancement: repair characters, remove lines and fill holes.


2) DBPix - The Image Control for Microsoft® Access

http://www.ammara.com/index.html
Add images to Access databases, easily and efficiently with DBPix, the High-Performance Image Control for Access.

3) AccessImagine ActiveX

http://access.bukrek.net/
browse and load, drag-n-drop, paste from clipboard, aquire from scanner or web-cam images right to database, in-place cropping tool, undo, old OLE data support, display HTTP (web) images, JPEG, BMP, GIF and PNG  file formats support, store images in JPEG format to save space, external image storage with automatic maintaince, anti-aliased image display, automatic resampling, continuous forms solution, on-click full-screen image display fitted to screen or with panning tool, opens image on-click in editing application, 90 degrees image rotating, VBA scripting image manipulations, SQL Servers and .NET languages support, x64.


What I find works best:

Do not store the images in the database. Only store the path to the file.

To edit the file I use ShellExec to open the file in the default image editor. You could use Sell to specific the program and file path.

That is it. That easy. The key is the changes must be saved back to the original file name.
0
 

Author Comment

by:rogerdjr
ID: 39703237
I use microsoft windows 8 paint version 6.3 as my default photo editor - but I would be fine with opening the photo in acrobat or some other "basic" photo viewer.

As you suggested I store the file & path in the database not the photo.

How would I "To edit the file I use ShellExec to open the file in the default image editor. You could use Sell to specific the program and file path. "
0
 
LVL 21

Accepted Solution

by:
Boyd (HiTechCoach) Trimmell, Microsoft Access MVP earned 2000 total points
ID: 39703570
Here is the code I use for ShellExec


I would place this code in a standard code module named something like modShellExec.
Option Compare Database
Option Explicit

Public Const SW_HIDE = 0
Public Const SW_NORMAL = 1
Public Const SW_SHOWNORMAL = 1
Public Const SW_SHOWMINIMIZED = 2
Public Const SW_MAXIMIZE = 3
Public Const SW_SHOWMAXIMIZED = 3
Public Const SW_SHOWNOACTIVATE = 4
Public Const SW_SHOW = 5
Public Const SW_MINIMIZE = 6
Public Const SW_SHOWMINNOACTIVE = 7
Public Const SW_SHOWNA = 8
Public Const SW_RESTORE = 9
Public Const SW_MAX = 10
Public Const SW_SHOWDEFAULT = 10



Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long


Public Function bimShellOpenFile(strFilePath As String, lngShowCmd As Long) As Long
'
' opens the file passed by calling windows
' the file should be opened into the app associated with the files type
'

Dim r As Long
Dim hwnd As Long

r = ShellExecute(hwnd, "open", strFilePath, "", "", lngShowCmd)

bimShellOpenFile = r


End Function

Open in new window

0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Closing Comment

by:rogerdjr
ID: 39713359
Thanks for the help - end result was:

Function OpenImage(sFilePathAndName As String)
       On Error GoTo Error_Handler

       Shell Chr(34) & "C:\Windows\System32\mspaint.exe" & Chr(34) & " " & Chr(34) & sFilePathAndName & Chr(34), 1

       If Err.Number = 0 Then Exit Function

   Error_Handler:
    MsgBox "MS Access has generated the following error" & vbCrLf & vbCrLf & "Error Number: " & Err.Number & vbCrLf & "Error Source: OpenImage" & vbCrLf & "Error Description: " & Err.Description, vbCritical, "An Error has Occured!"
   Exit Function
End Function
0
 
LVL 21
ID: 39714454
Thanks for the update and points.

I would also add a test to see if the file exists before executing the Shell().

Example:
Function OpenImage(sFilePathAndName As String)
       On Error GoTo Error_Handler

       ' Test to be sure the file exists before opening
       If Len(Dir(sFilePathAndName )) < 0 then 
            MsgBox "File not found!"
            Exit Function
       End If

       Shell Chr(34) & "C:\Windows\System32\mspaint.exe" & Chr(34) & " " & Chr(34) & sFilePathAndName & Chr(34), 1

       If Err.Number = 0 Then Exit Function

   Error_Handler:
    MsgBox "MS Access has generated the following error" & vbCrLf & vbCrLf & "Error Number: " & Err.Number & vbCrLf & "Error Source: OpenImage" & vbCrLf & "Error Description: " & Err.Description, vbCritical, "An Error has Occured!"
   Exit Function
End Function 

Open in new window

0
 

Author Comment

by:rogerdjr
ID: 39715087
Thanks
0

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

New style of hardware planning for Microsoft Exchange server.
Microsoft has changed the look and feel of Azure AD and Microsoft account sign-in pages so that you will have a more unified look and feel when moving between the two interfaces.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question