A script-enabled browser is required for this page to function properly.

READ_IMAGE_FILE Built-in

Description

Reads an image of the given type from the given file and displays it in the Oracle Forms image item.

Syntax

PROCEDURE READ_IMAGE_FILE
(file_name VARCHAR2,
file_type
VARCHAR2,
item_id
ITEM);

PROCEDURE READ_IMAGE_FILE
(file_name VARCHAR2,
file_type
VARCHAR2,
item_name
VARCHAR2);

Built-in Type unrestricted procedure

Enter Query Mode yes

Parameters

file_name 
 
Valid file name. The file name designation can include a full path statement appropriate to your operating system.
 
file_type
 
The valid image file type: BMP, CALS, GIF, JFIF, JPG, PICT, RAS, TIFF, or TPIC. (Note: File type is optional, as Oracle Forms will attempt to deduce it from the source image file. To optimize performance, however, you should specify the file type.) Oracle Forms does not support multi-page TIFF.
 
item_id 
 
The unique ID Oracle Forms assigns to the image item when it creates it. Use the FIND_ITEM Built-in to return the ID to an appropriately typed variable. Datatype is ITEM.
 
item_name 
 
The name you gave the image item when you created it. Datatype is VARCHAR2.

Usage Notes

Restriction

Oracle Forms does not support multi-page TIFF.

READ_IMAGE_FILE Examples

/* Read an image from the filesystem into an image item on the
** form. In this example, the scanned picture identification
** for each employee is NOT saved to the database, but is
** stored on the filesystem. An employee's photo is a TIFF
** image stored in a file named <Userid>.TIF Each employee's
** Userid is unique.
** Trigger: Post-Query
*/
DECLARE
tiff_image_dir VARCHAR2(80) := '/usr/staff/photos/';
photo_filename VARCHAR2(80);
BEGIN
/*
** Set the message level high so we can gracefully handle
** an error reading the file if it occurs
*/
:System.Message_Level := '25';
/*
** After fetching an employee record, take the employee's
** Userid and concatenate the '.TIF' extension to derive
** the filename from which to load the TIFF image. The EMP
** record has a non-database image item named 'EMP_PHOTO'
** into which we read the image.
*/
photo_filename := tiff_image_dir||LOWER(:emp.userid)||'.tif';

/*
** For example 'photo_filename' might look like:
**
** /usr/staff/photos/jgetty.tif
** ------
**
** Now, read in the appropriate image.
*/

READ_IMAGE_FILE(photo_filename, 'TIFF', 'emp.emp_photo');
IF NOT FORM_SUCCESS THEN
MESSAGE('This employee does not have a photo on file.');
END IF;
:SYSTEM.MESSAGE_LEVEL := '0';
END;