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.

160 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. Can you use a ADF to scan multiple pages to one pdf?

    Reply
    • Nope, that is not possible with AccessImagine.

      Reply
  5. 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
  6. 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
  7. 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
  8. 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
  9. 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
  10. 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
  11. Hello! How to change the default photo filename “SCAN__.jpg” to other custom initial?

    Reply
    • If you bind AccessImagine to some text/number unique field, it will be used as filenames source.

      Reply
  12. HI,
    is there an way to center the copped image to the control? All cropped imaged are alligned to the left top corner…

    many thanks
    Werner

    Reply
    • Nope, there is no such an ability.

      Reply
  13. This is a great object and displays picture files perfectly. Just one question how can you get GIF files to display in animated form?

    Reply
    • Thank you! Animations are not supported.

      Reply
      • OK thanks for the quick reply. It is a shame gif animation is not supported, this was just what I was looking for but I need to display the gif on an Access form in it’s animated state. I would definitely have purchased it immediately if it could. The only way I can see is with the WebBrowser object but it’s just so limited and the background cannot be changed to transparent which is what I need . Anyway Max, Thanks for your assistance. If you ever change the control or know of anything else please let me know. Thanks again for your work.

        Reply
  14. Hi Max – I have successfully run AccessImagine on one Windows laptop and it is exactly what I was after.

    I am testing it on a second Windows laptop and I have run into an issue. It appears to be a compatibility issue with the Integrated Camera on the laptop. When I go to capture the image, it is solid white and a note at the top left corner says:

    Unknown Compression
    DataSize: 2764800 FourCC: MJPG

    Any insight on what this is or how to fix it?

    Many thanks,

    Reply
  15. Hi,

    We have a database that has been working for 4 years (with ActiveX) and last week it stopped displaying two images (.jpeg) giving 2 types of errors:

    1.) “not enough storage is available to process this command”
    2.) “image can’t allocate the dib handle”

    We have created a new database with ActiveX and it displays both .jpegs with no problems. Both .jpegs are similar in size.

    Any advice or ideas as to what may have caused this and how we go about fixing it?

    Reply
  16. Hello. How can I check which version of AccessImagine is installed on a given computer? Thanks.

    Reply
  17. Hello. Sorry for the trouble with my previous question. I just found how to get the version number of AccessImagine. Control Panel / Programs and Features, and in the list the version number is displayed next to the app name. Sorry again. And thanks in any case.

    Reply

Submit a Comment

Your email address will not be published.