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.

172 Comments

  1. Please allow one more question. In the StoragePath property of my ole picture field I used a dot (“.”) as path, so as to have the captured image stored in the same folder as the main file of the database that includes the field the ole is bound to – as it is indicated in this documentation. However, instead of doing so the captured image is systematically stored in the C:\UserName\Documents folder. Am I doing something wrong?

    Reply
    • Current path in Access is set differently depending of the way you open the database. When you open it thru File-Open you get one result, when you open it from link or explorer – you get another.

      Reply
      • Ok, thanks. I’ll work accordingly! Best.

        Reply
  2. Really it is fine.

    Reply
  3. Can you explain the scripting? I can insert and display the images within my database fine. But I can not copy them once they are in the database.

    What am I missing?

    Reply
    • Please tell me more, where are you trying to copy your images?

      Reply
      • I may need to move or copy the pictures to a different application.

        Reply
        • That is possible, but depends of details.

          Reply
  4. Hello, good work.
    One question : how do we modify script options ? In fact, I would like to rotate an image to show it vertically after getting it, how do I manage it ?

    Reply
    • There is no script, AccessImagine is Windows ActiveX component.
      From which source do you get this image you need to rotate?

      Reply
      • I get it from a camera. I said script because there is a section called “Scripting options”. I have managed to rotate using a button and TurnRight option in VB. I do not know why but though ActiveX Object was working perfectly to get the images, AccessImagine was not in the list of available VB references and TurnLeft/Right was not working. So I downloaded it again and now I can use it in VB…

        Reply
        • Yep, you can rotate it with VBA, but there is no event handler for image receiving. AccessImagine tries to guess camera orientation, does it fails for you?

          Reply
          • Yes it fails, it is always horizontal. But it is an old camera (I can get the image files in the camera but I can not take a picture directly from AccesImagine in fact).

  5. Yes it fails, it is always horizontal. But it is an old camera (I can get the image files in the camera but I can not take a picture directly from AccesImagine in fact).

    Reply
  6. Can you use a ADF to scan multiple pages to one pdf?

    Reply
    • Nope, that is not possible with AccessImagine.

      Reply
  7. We have successfully installed your program under access 97 and it is happily saving images as desired. We have added some code to check if the image already exists in a certain directory, and provided for multiple images associated with the same ID. We now notice that those images which have been viewed under access the program writes the jpg file into the My Documents directory (with a different file date)

    Reply
  8. Can you give me an example of how to scan without user assistance. ie. instant scan?

    Reply
    • You can write at VBA:

      Pic.InstantScan(1)

      What are you trying to do?

      Reply
  9. Hello. I am storing thumbnails of external images in an SQL server 2012 table with a field type of image. Everything works properly. When I try to store the same data in a field of type varbinary(max) it fails. Microsoft will no longer support image in the future (SQL Server 2016+). Any suggestions? Thanks.

    Reply
    • That is strange, AccessImagine works with VARBINARY fields.

      Reply
      • You are correct sir! Tried it again and it works fine.

        Reply
  10. Hi,

    I have developed an MS-Access 2010 database and I use AccessImagine in it, whereby one of the fields in a form captures images via a Microsoft LifeCam HD USB camera.

    It all works fine, in general, with the following exception. Sometime clicking the image field to capture an image doesn’t work – it says camera unavailable. Statistically, for 150 images captured on a typical day, this happens once or twice. It is only after exiting the MS-Access application and restarting it that things work again.

    I picked my brain and did all the troubleshooting I can think of but can’t find why this happens. I checked that the camera driver is up to date. Any idea? Any suggestion I can try? Thanks.

    Reply
  11. Hi Max D,

    Thanks for your great control!

    Firstly, I’m a bit of a newby with Access 2007. I have a database that keeps track of stock and inventory for car parts. The data is imported from a Website and includes the URL of the image that is displayed for each part on the website. The field name in the Parts table is called [PartImageURL].

    I have successfully installed your control but can’t figure out how to configure your control so that it references the [PartImageURL]field and displays the image from the website in the control….

    Would you mind providing me with some help?

    Thanks very much.

    Cheers
    Greg

    Reply
  12. Hi Max D

    I figured out that the [PartImageURL] field needed to be defined as a Text field!

    All working!

    Cheers
    Greg

    Reply
  13. how to copy scanned image directly from accessimagine picturebox to another picturebox in c# ???

    Reply
    • Maybe thats a bit late… You can access JPEG representation of image via Pic.Image

      Reply
  14. Hi!
    At first – very good program :-) By now I’m using only demo, but I consider to buy full version.

    I have one issue. I have some Access projects, that doesn’t need any pictures. But if I open this kind of MS Access files on computers, that only have Access runtime environment (with full MS Access is the same), the computer can not open file because of missing AccessImagine. I can’t / don’t want to install AcessImagine on every computer, so is there any possibility to switch off your plugin for unneeded files?
    Looking forward to hearing from you :-)
    Best regs
    Jed

    Reply
    • It looks like you have inserted AccessImagine into this projects, and then removed it. The reference to the library still remains.

      Open VBA editor, go to Tools -> References and untick AccessImagine.

      Reply
  15. I have placed this control on a form but every time I add a new record or move between records, the control shrinks, changing the layout of the entire form.

    Reply
    • Remove control border, for some reason it causes this effect.

      Reply
  16. Hi,

    I was wondering if its possible to save the picture to both external storage and at the same time save it in the database?

    Thank You

    Reply
    • AccessImagine will do only one of this things. You need to write in VBA the another one.

      Reply
  17. Hi!
    Is there any way to take a snapshot without delay?
    The .scan method “loads” the camera and then takes the snapshot, so there is a few delay. Is it possible to mantain the cam loaded, so when you click a button, it immediately gets the image?

    Reply
    • Nope, that is impossible with AccessImagine.

      Reply
      • No vba code possible?

        Reply
  18. In my database the AccessImage is very small. It doesn’t fill up the field. Why does it do that?

    Reply
    • You can stretch it. But you could place it inside the cell. You need to place it outside of any cells.

      Reply
  19. sir Max im trying to use it however im unable to see the lighthouse picture prompting “because of your security settings and current security policy this control is disabled.”

    Reply
  20. Dear Max, Great tool which adds tremendous value to my database application. A query about ImageBind. I cannot seem to work out how to use it to change or provide a ControlSource at runtime. Would you provide an example of code? thanks, Lance

    Reply
  21. Hallo,
    I have used the paint.net as standard application for jpg-files in Windows 7/Access 2003 for a long time. Now I have changed to Windows 10/Access 2016 and OnClick/OpenPictureFile doesn’t work with paint.net. Could you bring it back?

    Reply
    • Try to set proper windows association for JPG files.

      Reply
      • I did it. It doesn’t work.

        Reply
    • How your system behaves when you double-click at JPG file?
      How AccessImagine behaves when you click to open picture?

      Reply
      • If I assign paint.net to jpg-files as standard application, the jpg opens with paint.net when I double-click the file. If I try to open the picture with AccessImagine, nothing happens. The same behaviour I see with paint from Microsoft and with GIMP (Version 2.8).

        If I assing IrfanView (Version 4.27) or the Windows Photos App to jpf-files, AccessImagine opens the picture with the assigned application as well as a double-click on the file in the file system.

        Reply

Submit a Comment

Your email address will not be published.