DBPix Documentation
Version 2.0

ImageLoad Method


Description:  Loads an image from disk, prompting the user to select a file using the standard 'File Open' dialog.
Syntax:  boolean ImageLoad()
Return Value:  
True    The image was loaded successfully.
False    An error occurred, e.g. DBPix is bound to read-only data, the image selected was not a recognized format, or the user did not choose a file.
Remarks:  

After decoding the image it will be resampled (resized) if specified by the ImageResampleMode property, then encoded according to the ImageSaveFormat property (and any relevant format-specific property settings for JPEG, PNG etc).

The ImageModified. and ImageChanged events will be fired, and if DBPix is bound to a data-source the source will be updated.

To simply display an image file, use the ImageViewFile method.

To prevent recompression of JPEG images (and avoid unnecessary JPEG 'generational loss') see the JPEGNoRecompress property (ImageResampleMode must also be set to ImageResampleModeOriginal [1]).

Image files can also be loaded via the context-menu at runtime (the ViewMenuMode property controls which menu-items are displayed at runtime).

You can also display a File-Open dialog using API calls, then pass the path of the selected file to ImageLoadFile. This allows the developer to customize the dialog, and provides access to the path and filename that was chosen (for storage in a table, for example).

See also the ImageLoadFile method, which takes the file to load as an argument.

 

 

Documentation version 2.0.0