ReadImageFile

Revision as of 19:20, 7 December 2015 by Lchrisman (talk | contribs) (Removed old text about being experimental)


What's new in Analytica 4.2? >

(Requires Analytica Enterprise or Power Player)

ReadImageFile( filename, showDialog )

Reads an image file into memory and returns an value that acts as a handle to the image and can be assigned to the Pict attribute of an object on a diagram.

The optional parameter, «showDialog» controls whether the file dialog appears. If not specified, then the dialog appears only if the file does not exist. To prevent this from showing (displaying an error instead) specify showDialog as false. To force the dialog to display, even if the file exists (i.e., as a way to give the user a chance to change the filename, while still providing a default name), specify showDialog as true.

From ADE, the dialog is never displayed.

Uses

I foresee where certain applications may need to integrate with an external application that generates an image, and then may want to embed the image in a diagram. Analytica might launch the external command using RunConsoleProcess, sending it commands and data either through stdIn or via a data file, and waiting for it to complete. The external program would produce an image (e.g., a JPEG) and store it in a file. Analytica would then use ReadImageFile to read in the resulting, dynamically created, image and assign it to the Pict attribute of a picture node on the diagram. To update the dynamic image, it would repeat the process.

External processes that might be used in the fashion might include GIS systems, drawing programs, or external graphing engines.

Presently, this reads the image only from a file on disk. There is no facility at this time to read an image from a web URL. That would be a natural extension of functionality in the future, although it may be better do so by extending ReadFromUrl to convert MIME types to image objects. There is also no facility currently for extracting "blobs" from database queries and converting them to functional image objects.

Image handles currently display in result tables in a textual form. This is also tentative and subject to change, with the possibility that future releases will display the graphical image directly in the result table.

See Also

Comments


You are not allowed to post comments.