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 with create_timer:

(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:
 
Declare
tm timer;
begin
   ---- 3000 milliseconds = 3 seconds
   create_timer('foxtimer', 3000, repeat);
end;

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

begin
-- this will change the images in image item in every 3 seconds 
  read_image_file('C:\Documents and Settings\yourpc\My Documents\My Pictures\image'||
  :parameter.nprm||'.jpg', 'JPEG', 'block3.IMAGE7');
  :parameter.nprm := :parameter.nprm + 1;
if :parameter.nprm > 10 then
   :parameter.nprm := 1;
end if;
end;

See also: Create timer to display clock in Oracle Forms


posted @ 2016-12-25 18:11  全威儒  阅读(319)  评论(0编辑  收藏  举报