BBjImageManager::loadImageFromBytes

Description

In BBj 7.0 and higher, this method loads a BBjImage object from a string containing binary data.

Syntax

Return Value

Method

BBjImage

loadImageFromBytes(string binary)

Parameters

Variable

Description

binary

String containing the binary data of the image.

Return Value

Returns the image as a BBjImage object.

Remarks

Use to create images from BLOB data stored within a database.

Example

gb__imageFile$ = "C:/images/find.ico"
myAPI! = BBjAPI()
SYSGUI = UNT
OPEN (SYSGUI) "X0"
mySysGui! = myAPI!.getSysGui()
myWindow! = mySysGui!.addWindow(10,10,200,200,"BBj Window")
myToolButton! = myWindow!.addToolButton(101,50,100,90,30,"",$0800$)
myToolButton!.setOpaque(0)
CALLBACK(ON_CLOSE,APP_CLOSE,mySysGui!.getContext())

rem 'Typically the developer would have obtained the bytes in im$ through less
rem 'hokey means. Perhaps a BLOB in a DB, or even calculated on the fly.
chan = unt
open(chan,isz = -1)gb__imageFile$
readRecord(chan,siz = -4000)im$
close(chan)
man! = BBjAPI().getSysGui().getImageManager()
mage! = man!.loadImageFromBytes(im$)
myToolButton!.setImage(mage!)

rem 'Process Events
process_events

rem 'Callback routine called when the user closes the application window
APP_CLOSE:
release

See Also

BBjAPI

BBjSysGui

BBjImageManager

BBjImage

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