PreviousNextIndex

DEFINE IMAGE statement


(Windows only; Graphical interfaces only)

Defines an image widget in a graphical interface that is created at compile time for use within a single procedure or class. An image widget is a container for an operating system image file and can be displayed in a form or used as a form background.

Note: Does not apply to SpeedScript programming.
Syntax

DEFINE [ PRIVATE ] IMAGE image-name 
  { image-phrase | LIKE image | size-phrase } 
  [ BGCOLOR expression ] 
  [ FGCOLOR expression ] 
  [ CONVERT-3D-COLORS ] 
  [ TOOLTIP tooltip ] 
  [ STRETCH-TO-FIT [ RETAIN-SHAPE ] ] [ TRANSPARENT ] 

[ PRIVATE ] IMAGE image-name
IMAGE image-name
image-phrase
LIKE image
size-phrase
BGCOLOR expression
FGCOLOR expression
CONVERT-3D-COLORS
TOOLTIP tooltip
STRETCH-TO-FIT
RETAIN-SHAPE
TRANSPARENT
Example

This procedure defines an image widget named trashcan, and loads into the widget a series of operating system image files that create an animation of a fire burning in a trash can. The user begins the animation by choosing the Animate button. This procedure serves as an illustration only. It depends on the existence of image filenames ANI01, ANI02. ... ANI14 , which are not provided.

r-image.p
DEFINE VARIABLE repeat_loop    AS INTEGER NO-UNDO. 
DEFINE VARIABLE animation_loop AS INTEGER NO-UNDO.. 
DEFINE VARIABLE lok            AS LOGICAL NO-UNDO.. 
DEFINE BUTTON animate LABEL "Animate". 
DEFINE IMAGE trashcan FILE "ANI01.BMP". 
DISPLAY animate trashcan WITH FRAME y TITLE "**  Animation Sample  **". 
ON CHOOSE OF animate IN FRAME y DO: 
  /* Begin Animation */ 
  DO repeat_loop = 1 TO 5: 
    DO animation_loop = 1 TO 14: 
      lok = trashcan:LOAD-IMAGE("ANI" + STRING(animation_loop,"99"))  
        IN FRAME y. 
    END. 
  END. 
END. 
UPDATE animate WITH FRAME y. 

Notes
See also

Class-based data member access, FORM statement, Image phrase


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex