BBjImageManager::loadImageFromFile

Description

In BBj 5.0 and higher, this method loads a BBjImage object from a file.

In BBj 16.0 and higher, the index parameter selects a particular image from a Windows .ico file.

Syntax

Return Value

Method

BBjImage

loadImageFromFile(string filename)

BBjImage

loadImageFromFile(string filename,int index)

Parameters

Variable

Description

filename

Name of the file that contains the image to be loaded.

index

For Windows .ico files, this selects a specific image from the file.

Return Value

Returns the image as a BBjImage object.

Remarks

Use the full path to the file or a file that is in the current directory or PREFIX.

Example

rem ' BBjImageManager::loadImageFromFile

sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
imagemanager! = sysgui!.getImageManager()
filename$ = "bbj.ico"
image! = imagemanager!.loadImageFromFile(filename$)
print filename$,image!.getWidth(),image!.getHeight()
images = imagemanager!.getImageCount(filename$)
print filename$," contains",images," images"
for i = 0 to images-1
    image! = imagemanager!.loadImageFromFile(filename$,i)
    print filename$,i,image!.getWidth(),image!.getHeight()
next i

See Also

BBjAPI

BBjSysGui

BBjImageManager

BBjImage

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.