Try OpenEdge Now
skip to main content
ABL Reference
Handle Attributes and Methods Reference : LOAD-IMAGE( ) method
 

LOAD-IMAGE( ) method

(Windows only; Graphical interfaces only)
Reads the image contained in a specified file. When applied to a button widget, the image is used for the button in its up state, and also for its down state if a separate down state image is not specified. For buttons, this is equivalent to the LOAD-IMAGE-UP( ) method.
Return type: LOGICAL
Applies to: BUTTON widget, IMAGE widget

Syntax

LOAD-IMAGE ( filename [ , x-offset , y-offset , width , height ] )
filename
A character-string expression that specifies a full or relative pathname for a file that contains an image. The pathname can contain Unicode characters. See OpenEdge Development: Internationalizing Applications for more information about Unicode.
x-offset
An integer expression that specifies the pixel along the x-axis at which to begin reading from the image file.
y-offset
An integer expression that specifies the pixel along the y-axis at which to begin reading from the image file.
width
An integer expression that specifies the number of pixels along the x-axis to read from the image file.
height
An integer expression that specifies the number of pixels along the y-axis to read from the image file.
The image is not displayed until the widget is realized. If the read is successful, the method returns TRUE.
In Windows, you can specify a URL pathname. If you specify a fully-qualified URL, LOAD-IMAGE( ) loads the image file directly without searching directories or URLs in PROPATH. Valid URL protocols include HTTP and HTTPS.
Note: URL pathnames cannot contain the percent symbol (%). If an error exists in a URL specified on the PROPATH, the LOAD-IMAGE( ) method continues searching with the next PROPATH entry.
If you specify URL pathnames on the PROPATH and your application repeatedly uses the LOAD-IMAGE( ) method with a URL pathname, you can improve performance by using the SEARCH function once to determine the full URL pathname to the directory containing the image files. Use this value to create a fully-qualified URL pathname for filename and avoid repeated searches of the PROPATH.