Press "Enter" to skip to content

Create Timer Example To Show Image Presentation in Oracle Forms

Suppose you want to change multiple images after a specified time in home screen of your oracle forms application. Follow these simple steps to create image presentation using create_timer in Oracle Forms:
(1) Place an image item on canvas and set the appropriate size and other properties for image item.
(2) Create a parameter in object navigator with any name and the data type of the parameter should be number type and specify the default value 1.
(3) You must have multiple images with name like image1.jpg, image2.jpg, image3.jpg and so on.
(4) Then create when-new-form-instance trigger at form level and place the following code:
tm timer;
   —- 3000 milliseconds = 3 seconds
   create_timer(‘foxtimer’, 3000, repeat);

(5) Then create when-timer-expired trigger in form level and place the following code:

— this will change the images in image item in every 3 seconds
read_image_file(‘C:Documents and SettingsyourpcMy DocumentsMy Picturesimage’||
:parameter.nprm||’.jpg’, ‘JPEG’, ‘block3.IMAGE7’);
:parameter.nprm := :parameter.nprm + 1;
if :parameter.nprm > 10 then
:parameter.nprm := 1;
end if;

See also: Create timer to display clock in Oracle Forms