BBjImageManager::getImageCount

Description

In BBj 16.0 and higher, this method returns the number of images in an image file.

Syntax

Return Value

Method

int

getImageCount(string filename)

Parameters

Variable

Description

filename

Name of the image file.

Return Value

For Windows .ico files, this returns the number of icons in the file. For other image files (png, jpg, bmp, gif), it returns 1. For non-image files, it returns 0.

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.