Documentation

AccessImagine is ActiveX component to make storing images in various projects as easy as possible. It:
·supports JPEG, BMP, GIF and PNG  file formats
·stores images in JPG format to preserve space
·works with Access and other database applications
·generates previews in JPG and OLE format (for displaying in continuous forms)
AccessImagine design time options
These options are available in property inspector, when you design a form, report or application.
MaxWidth and MaxHeight
If the image exceeds this constrains, it is proportionally scaled down. This applies only when image is saved, preserving full image size for cropping.
StoragePath
If you like not to keep images in database, specify the location for them. In this case bind component to database field that is to hold image file names. Examples of valid pathes:
·“D:\MyWork\Images”
·“\\Avenger\Incoming\Pics” – local network path, useful for centralized storage
·“Pics” – subfolder in folder, where your database file is stored
·“.” – keep images in the same folder with database file
EmptyImage
You can select the appearance of control when it is empty. It can be a Contact sign, Photo sign of simple gray brick (None).
AccessImagine scripting options
Image
Represents picture in control, you can read and write it to manipulate with images.
Changed
Checks if image was changed from the last time this function was called.
PreviewJPG(Size) and PreviewOLE(Size)
These functions generate small previews of image in control. Size specifies the longest side of preview, if omitted it defaults to 64 pixels. If you need to save OLE previews along with your images,  insert this in Exit event procedure of AccessImagine object:
If <AccessImagine>.Changed Then <OLE preview field>.Value = <AccessImagine>.PreviewOLE
LoadFile(filename) and SaveFile(filename)
Use these functions for batch processing and advanced manipulating. SaveFile saves images only in JPG format.

AccessImagine is ActiveX component for storing images in various projects as easy as possible. You need to place it on form while designing your application and bind to some database field.

AccessImagine features:

  • JPEG, BMP, GIF and PNG  file formats support
  • store images in JPEG format to save space
  • get images from TWAIN and WIA devices
  • get images from video sources (including webcams)
  • paste image from any Windows application
  • in-place image croping tool
  • HTTP images display
  • OLE fields support
  • previews in JPEG and OLE formats (for displaying in continuous forms)
  • external image storage
  • on-click big image display

Design time component properties

These options are available in property inspector, when you design a form, report or application.

Background

Specify the control background in hex form (i.e. 00000 is black and FFFFF is white)

Cropping

Cropping type selection:

  • Proportional – cropping tool keeps control’s proportions
  • Normal – crop any proportions
  • Auto – images are automatically cropped to control’s proportions on insertion

EmptyImage

You can select the appearance of control when it is empty. It can be a Contact sign, Photo sign or simple brick (None).

MaxWidth and MaxHeight

If the image exceeds these constrains it will be proportionally scaled down. This applies only when image is saved while preserving full image size for cropping.

StoragePath

In order not to keep images in database you need to specify a location for them. Bind component to database field which holds image file names in this case. Examples of valid locations’ paths:

  • D:\MyWork\Images
  • \\Avenger\Incoming\Pics” – local network path (for centralized storage, etc.)
  • Pics” – a subfolder in the folder, where your database file is stored
  • .” – keep images in the same folder with the database file

If empty.jpg image is present at StoragePath location, it will be used for empty control display

HideButtons

Set this to “Yes” if you don’t want to show the control buttons. It will look just like regular image this way.

OnClick

You can select the control’s behaviour when the user clicks the image.

  • None – do nothing
  • ShowFullPicture – show picture in new window, scaling it down to fit the screeen, if it is too big
  • ShowPanPicture – show picture in new window 1:1 size, giving the ability to pan via a hand tool
  • OpenPictureFile – open picture with the external application, that is associated with JPG filetype

Scripting options

EmptyText

The text shown where there is no image (usually “No Image“). Can be set to empty string.

Image

Represents the picture in the control, both reads and writes are allowed.

ImageBind

Data bound to control (like ControlSource). Use it for late binding or if usual field binding is not available (i.e. at Access 97)

InstantScan (delay)

Makes instant scanner/webcam image capture without user’s assistance. Will wait delay seconds after device initialization before taking image (it may be needed for some cams that adjust focus/brightness at first few seconds).

Changed

Checks if image has been changed since the last invocation of this function.

PreviewJPG(Size) and PreviewOLE(Size)

These functions generate small previews of the image in control. Size specifies the longest side of the preview, if omitted it defaults to 64 pixels. If you need to save OLE previews along with your images,  add the following code to Exit event procedure of the AccessImagine object:

If <AccessImagine>.Changed Then <OLE preview field>.Value = <AccessImagine>.PreviewOLE

LoadFile(filename)

Loads image from file or web (HTTP).  Supports JPEG, BMP, GIF and PNG  file formats.

SaveFile(filename)

Saves image to file.  Supports only JPEG format.

Scanning

Set to 0 to disable Use device button. Set to 1 to activate instant image capture without any dialogs.

TurnRight and TurnLeft

Rotates image 90 degrees clockwise and anti-clockwise.

Copy

Copies current image to clipboard, making it possible to paste image into another application.

Crop X,Y,X1,Y1

Crops the image with the given coordinates rectange.

PicWidth and PicHeight

Return the bitmap image dimensions.

Paste

Inserts image from the clipboard.

Rename(filename)

Rename file in external storage. For that cases, when you need to overcome auto-generated names.

Scan

Aquire image from last used source.

ScanSource

Read/write property, id of image source, where -1 is WIA, -2 is TWAIN, -3 is Microsoft WDM, 0 and up – direct webcams.

SelectSource

Opens source selection dialog.

ShowFullPicture and ShowPanPicture and OpenPictureFile

Perform the corresponding action from OnClick property description.

332 Comments

  1. I’m trying to use ManyCam as image source (works with the Camera app W10). And I’having the following error message “Unknown compression DataSize: 4147200 FourCC: YUY2”

    Is there a way around it?

    Reply
    • Unfortunately, there is no fix.
      But you can use Camera App as image source (with AccessImagine 1.74)

      Reply
  2. I see there is a turn right and turn left property. Can these be added as on picture controls along with the other controls?
    Thanks,
    Rob

    Reply
    • No, but you can create your own buttons on form for rotating.

      Reply
  3. i am trying to use the ExportWithFormatting macro to export a report with AccessImagine images in it as a pdf. The report shows the images fine, but the PDF does not display the images. Is there any way to make this work either through the ExportWithFormatting macro or OutputTo and acFormat VBA? I really appreciate any help you can provide.

    Reply
    • Does the regular PDF export via menu works properly?

      Reply
  4. Is there a way to display and print an image in a report?

    Reply
  5. I am using the control to scan and store images in a SQL table as OLE datatype. But when I scan the images in or import from a file, it shrinks the image to maybe 2/3 the original size. I then put the same control on a report in Access as we want to print the images and it does the same thing. I have tried to play with all the settings in the control and in Access to change this. I tried to resize the control on the form and just get grey or black areas around the image on the screen and printed. Does the control only show small sized images? Anyone else having this issue or any ideas what I need to do different?

    Reply
    • AccessImagine control should be resized properly. Just make sure that you do not drop it in form cell, or it will behave wrong there.

      Place new AccessImagine object somewhere there is nothing on form, then move to desired location.

      Reply
  6. Hello,
    I need to delete picture, paste picture and then start select area for croping, in one click from ms access form.
    Is it possible with the script/ VBA? Please help.
    Thank you.

    Reply
    • HOw to delete picture from VBA script?

      Reply
      • Try this:
        Pic.Image = “”

        Reply
        • Thank you,
          in VBA 2002 it work with this:
          Pic.Image = False

          Reply
          • Is it possible to start selecting image for cropping using VBA?

          • Unfortunately, no.
            But you can crop image via VBA to some coords with Pic.Crop X, Y, X1, Y1

          • Why the control doesn’t show Mouse_Down and Mouse_Up Event? I hope to use it to get X,Y,X1,Y1 Coordinate position.

          • Unfortunately, MS Access supports ActiveX events in very limited way.

          • What is the right input measurement unit for X,Y? ie. Inch, point or pixel?

          • Its pixel

          • Can I move the license from my old computer to new one?

          • Sure, just activate AccessImagine with your credentials on new computer.

  7. Hello,

    Is there anyway to check if an image control is displaying an empty image when bound to a textbox linking to the storage location?

    Reply
    • I do not have an ability to check and write you the exact code.
      But in general – you can check if Pic.Image property is empty.

      Reply
  8. How do you print a report with the images. The images are in the preview but blank in the PDF or when printed.

    Reply
  9. Hi,

    I was wondering where do you find the ScanSource option under the property sheet?

    Thank You

    Reply
    • It is not in property sheet, its runtime VBA property.
      To select source manually, perform right mouse button click on “Use Device” icon.

      Reply
  10. I really love this program but I have one issue I cannot find a fix for. Can you give an example of where and how the SaveFile(Filename) is to be used? In the control property sheet, which “name” does it want to go before .SaveFile? Data/OLE Class, Data/Class, Other/Name? Instead of it saving as “Scan.jpg” I would like to give it a specific name using VBA (or in one of the Property Sheet areas if that is how it is done). Currently I am using fso.CopyFile for “On Enter’ or “On Lost Focus”, but I need it to always save as a name I give it.
    I am a paid registered user, and I am wondering if this is supposed to go under “Other/Custom” but it show pulls up the AccessImage version window, and maybe that is the issue?

    Reply
    • Nevermind, I just got it to work. I had to remove the entry in the control’s Property Sheet / Other/ StoragePath. Then in VBA I added nameofcontrol.SaveFile(“c:\pictures\test.jpg”)

      Reply
  11. Hi,

    I am using the instantscan function, how do i rename each photo base on a text box in the form?

    At the moment it saving using the default name scan.jpg

    Thank you

    Reply
    • If you have some table field with that text, just bind AccessImagine to it. No need of separate picture field in this case.

      Reply
      • Thank you for your reply, that works :) Another question, how do I stop the file manager or photo editor being called up every time a photo is taken?

        Reply
        • What you mean? Do you have OnClick property set to OpenPictureFile?

          Reply
  12. Hi, i am trying to do a a late binding of the control during runtime to an ado recordset object that has the image date in one field.
    How can i do it?

    Thanks!

    Reply
    • Use ImageBind property (like Pic.ImageBind = … )

      Reply
  13. How would I setup/VBA a form to preview an imagine and after a delay automatically capture the photo?

    Reply
    • That is not possible with AccessImagine.
      You can capture a photo from VBA, but without preview.

      Reply
  14. I have created an Access database and migrate the backend to the sql server to access the db as multiuser. When a picture is added to the front end the following error comes.

    odbc call failed. [odbc driver 13 for sql server] string data, right truncation(#0)

    Reply
    • Check if picture field is of some BLOB type.

      Reply
    • Set your data type as image in SQL Server

      Reply
  15. I’ve been using your control for about three years now and it works fantastic in my application. My DB is run from a network drive and the image storage is in a sub folder on the same drive. What I am experiencing now is extreme save times when dragging and dropping a new image on the control. Sometimes it take upwards of a minute for the file to copy and the image to appear while locking the computer from any other function until it completes it’s task. I know that this is being caused due to the number of images being stored in the folder (roughly 75,000). If I direct the control to a new folder the process of dragging and dropping is lightning fast. Unfortunately due to historical records in the DB and the way the original program was written I cannot change the image path. Is there a way for the control to put the image in the sub folder without it waiting for the 75,000 picture index to load on each drag and drop? Just copy the image without querying the folder itself?

    Reply
    • I think I know what is going on. More likely you have default AccessImagine naming scheme.
      Lets say, AccessImagine tries to save image as «image1.jpg». It checks if filename is taken, if yes – it checks if «image2.jpg» is taken – and this cycle repeats 75000 times in your case.

      You can prepopulate image field with some unique filename for new records. AccessImagine will write image to that filename without checking the folder contents.

      Reply
      • How do I prepopulate the image field with a unique name?

        Reply
        • That turned out not to be as easy as I thought )

          In Form_Current write:
          If IsNull(pic) Then pic = “img” + Right(CStr(DateDiff(“s”, 0, Now())), 7) + “.jpg”

          Reply
  16. I just updated to 1.74 and purchased the developer license so I could use my DB on multiple PCs. Now when I open my forms none of the previous images display in the control is just a white box that I can no longer drag and drop to. How can this be fixed ASAP?

    Reply
    • First of all, make sure that you installed AccessImagine on that PCs.

      Second, maybe you need to enable ActiveX in Access security settings.

      Reply
  17. Thanks Max. It is installed, I’ve been using this OCX for almost 4 years now and everything was working fine until I updated to 1.74. I was able to roll back to 1.73 and everything works again, so it must be a glitch in the 1.75 update.

    Reply
    • Sad to hear that. AccessImagine 1.74 is working really, I have no idea why it acts so for you. Does it gives any error messages?

      Reply
  18. I purchased the licence, tested the program then read the documentation. The first install of you samples worked well where I tested all the features.

    When I added it to my form I get the following error on startup (load event) and on close …

    The expression On Load you entered as the event property setting produced the following error: A problem occurred while Microsoft Access was communicating with the OLE server or ActiveX Control.
    * the expression may not result in the name of a macro, the name of a user-defined function, or [Event Procedure]
    * There may have been an error evaluating the function, event, or macro

    How can I fix this and place it on my form?

    Reply
  19. Hello,
    after a few nights spent looking for a solution to my problem, I gave up and I am writing to you for support.
    Using AccessImagine on a continuous mask form, as per your suggestion I used the thumbnails and designed an edit form that opens when you click on the selected thumbnail. Everything works if the form’s data source is a table. On the other hand, if the continuous mask form is based on a query or otherwise filtered, saving the thumbnail from the modification mask causes the error <>.
    Of course, the record or field is not locked as it is saved before opening the edit form.
    Any suggestions are appreciated.

    Reply
    • ….sorry, i’ve used html tags to describe error…….
      here is:

      Could not update; currently locked by another session on this machine. (Error 3188)

      Reply
  20. Hi – I hope you can help – I have a database on SQL Server, everything was working fine with the image bound to the controlsource, though everything was a little slow. To speed things up I from using a bound form to using an ADODB recordset and now the images wont display at all. The images are in the database there as they show if I rebind the data to the form again.

    Its also works if I assign the image using DLookUp().

    A test script below, what am I missing?

    Private Sub Form_Load()
    Dim rs As ADODB.Recordset
    Set rs = New ADODB.Recordset

    rs.Open “SELECT * FROM dbo.stock WHERE stockID = 55”, cxnDb, adOpenDynamic, adLockOptimistic
    rs.MoveFirst

    Picture8.Image = rs!StockImage

    rs.Close
    Set rs = Nothing
    End Sub

    Reply
  21. I’m a new trainer for this version, I tried to set the storage path for not saving the images in the database but I could not, Where I should set the path folder. by VBA code or I must buy a developer version.

    Thanks

    Reply
  22. Testing Access Imagine 1.74 on my Access 2007 report hoping to eliminate an Access problem of skipping images in a random order. The Report prints a description and then 1-7 Images. Access Imagine prints the first description and the images associated with it. I get more descriptions but no additional images on the entire report. The database contains the description and the location of three images per record. It is also very slow.

    Reply
  23. Hi I found I could not save storagepath location in the properties unless the folder already exist. (At development time I will not know where the end-user of my software might want to set up the Image file store location)

    I was able to see the storagepath location on the form Onload Event, as follows:

    Me.Picture0.StoragePath = “C:\temp”

    Any picture then added to the picture box was saved in the C:\temp folder. I intend allowing the end-user to select a store folder location (UNC path stored) and store the folder path in the DB. Then each time the form is opened programmatically setting the image panel .StoragePath value each time the form is opened. Is this the most efficient way to arrive at a variable solution for the location of the external image store path.

    Thank you

    Reply
    • You can leave StoragePath empty if you populate it via VBA.

      Reply
  24. How do I release the image from the storagepath? When I try to eliminate it (kill (file)) after saving it in the DB, it does not allow me to do it, it tells me that “the file is in use” ‘- VbNet

    Reply
  25. The web cam images look inverted when I use the vbnet control in windows 10, and they look normal in win 7. In Microsoft Access they look normal, but I am programming in VBnet

    Reply
  26. Hi. Is it possible to use your solution using a Remote Desktop Connection? The sample database is unable to activate the camera on the local PC resulting in the following error – Windows Camera app error code 0xA00F4244. Is there any way around this issue?

    Reply
    • Ah, found out that I could edit my remote desktop connection to pull in my Windows webcam but I’m unable to do this on my Android tablet. Is it possible for this software to bridge the gap?

      Reply
      • Unfortunately, AccessImagine does not have any special features for RDP.
        If the camera is accessible as regular Windows camera, it should work.

        Reply
  27. How/where can I use the scripting options? In the vba code? Could you please show an example of what you describe as: “Scanning, Set to 0 to disable Use device button. Set to 1 to activate instant image capture without any dialogs.”? Thanks.

    Reply
    • Yep, its VBA. Lets say AccessImagine object has name “Picture0”. Then you write in form load event:
      Picture0.Scanning = 1

      Reply
  28. How to drag an image from a browser onto AccessImagine? Is that possible? It comes up with a forbidden sign.

    Reply
    • Nope, that is not possible. Right-click on the image, select “Copy image” and paste it into AccessImagine.

      Reply
  29. Is it possible to set the default directory for the import picture (lookup) command, instead of \users\pictures\ ?

    Reply
    • Unfortunetely, no.
      But you can drag-and-drop pictures from explorer window.

      Reply
      • Thanks Max. I’ll find a solution with the LoadFile command :-) It’s a very nice and useful komponent…
        /Jakob

        Reply
  30. Image resolution is low in test work.
    Can I upload it as the original image and view it on the form?

    Can I upload multiple images at once?

    Reply
    • Images are saved as JPEG with compression and there are no options for that.
      To attach multiple images to the record you need to use the subform.

      Reply
  31. I have no problems inserting pictures manually in my Access database, using AccessImagine, via forms. However, I would like to programmatically (with vba code) be able to insert a large number of images that are present externally, in a given folder on the disk, and to embed them. I could start with the sample db provided by AccessImagine, for example. What would be the code? If I use Insert Into statements, what would be the syntax? Thanks.

    Reply
    • Unfortunately, I do not know how to insert images directly into DB without using AccessImagine object on form.

      The easiest scenario is to keep that images externally. If you specify StoragePath to picture folder and bind AccessImagine object to the field that corresponds with image names (with or without .JPG), AccessImagine will display them automatically and will allow all the operations like edit or insert.

      Reply
  32. Thank you Max D

    Reply
  33. I’m evaluating your activex control starting form the sample Database you provide.
    In “contact” form (no continuous) I can’t capture image greater then just 150×84 px through my full hd webcam, no matter if (through selctsource method) accessed directly or through windown 10 camera app. It seems there are no settings to set resolution.
    Furthermore, when purchased developer license, will you provide an exhaustive guide to all properties and methods and related syntax?

    Reply
    • Thats quite strange. Maybe you have MaxWidth or MaxHeight specified in AccessImagine object properties?
      Here is all the documentation – https://access.bukrek.net/documentation

      Reply
      • Thank you Max, I confirm that limitation in resolution were due to MaxWidth and MaxHeight settings in control properties, as set in the demo downloadable database.
        As for the documentation, IMHHHHO I’d suggest a little more effort from you.
        By the moment I’m using:
        —–
        Dim accimg As AccessImagine.Picture
        Set accimg = Me.Pic.Object
        —–
        to get intellisense and explore this control.

        Reply
        • Have you found anything that is not covered in documentation?

          Reply
          • No Max! It’all covered, perhaps just a BW method that I suppose will make image Black and White (?) :-). I meant just something closer to MS-style help to which me and maybe someone else is accostumed to:
            Methods
            BW: ….
            Changed: ….
            ….
            Properties
            Background: [readonly] [read] [write]
            Cropping: ….
            ….
            Anyway…well done, really huseful activex control!

  34. Hello Max. the Accessimagine Activex control on my MS-Access form is linked to external pictures, stored on a folder on the disk. It all works alright. In some cases, like for instance when an external picture has been deleted, nothing would show on the form’s activex control, of course, and instead the usual “Contact” or “Photo” default pic template would show. Is there a way, programmatically (i.e. not visually) to detect when the linked picture was not found? Thank you.

    Reply
    • I do not remember for sure. You need to test Pic.Image if it is null or false or “”

      Reply
  35. … another similar question: is there a way, programmatically, to tell if an Accessimagine Activex control on an Access form, with an embedded picture (i.e. not linked to an external pic) is empty or not?

    Reply
    • Thanks Max. Tried all of that, none did what I had in mind. Thank you anyway :) – appreciated.

      Reply
      • I have checked to be sure. This check for empty image works:

        if Picture0.Image = “” Then …

        Reply
      • But this doesn’t work for scenario when there is no filename field, sorry.

        The only way in your case is to check if the file with corresponding name exists in picture folder.

        Reply
  36. What is the shortest delay allowed in InstantScan (delay)? The shortest I can get down to without errors is 2 seconds.
    With SnapShotCamera
    .Visible = True
    .StoragePath = lblPath_RCPics.Caption
    .BorderColor = RGB(255, 255, 0)
    .InstantScan (2)
    .TurnRight
    .Rename (sFilename)
    .BorderColor = RGB(39, 139, 39)
    End With

    Reply
    • That depends of how much time is needed for camera to initialize, focus and catch the light conditions.

      Reply
  37. Hi Max, I have another issue. Whenever a user expands the image and then closes that window, it results in this error from MS ACCESS: “Access violation at address 00000000006DCF8E in module ‘ACCESS~1.OX’. Read of address 000000024B7EE5FB8.” They are able to close the message and keep working in the database, but when they go to log off, it gets hung up and force closes. When the user doesn’t expand the image, they don’t get an error and the database closes properly. Any ideas?

    Reply
    • Unfortunately, I have no ideas (
      You can use OpenPictureFile option and associate JPGs with the viewer that fits your needs.

      Reply
  38. hello. i can use this activex on visual basic 6.0?

    Reply
    • Yep, I think so. Anyway, thats easy to test.

      Reply
  39. A rather strange case. I have an MS-Access form with Accessimagine activex control. If I enter the control and capture/add a pic stored on my disk, it works fine. I can also add, delete and edit/replace pics this way. Now, if I take this this form and use it as a child form (as a subform) in a parent form, adding and deleting pics work alright, but editing/replacing the originally saved pic does not. I do get to the buttons that let me choose a new picture to replace the existing one, but it is not saved in the end – the previously saved picture that was entered when I added it first remains.

    I went through all the troubleshooting and testing I could think of: ensuring that the child form allows editing, that the activex control buttons are not hidden, that it is not locked, etc… but to no avail. I will keep trying, but would appreciate it if you have any advice, suggestion or idea. Thanks.

    Reply
  40. Please disregard my previous comment/question earlier today. I found the solution. I had not properly set the AllowEdits property of the subform. Apologies.

    Reply

Leave a Reply to Jean-Claude Cancel reply

Your email address will not be published.