
BBjMDI::setBackgroundImage
Description
In BBj 15.0 and higher, this method places one or more background images on the MDI desktop.
Syntax
Return Value |
Method |
---|---|
void |
setBackgroundImage(int location, BBjImage image) |
Parameters
Variable |
Description |
|||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
location
|
One of the following image locations:
Multiple image locations are painted to the desktop in the numeric order of these constants. A FILL image will appear under any other images. |
|||||||||||||||||||||||||||||||||
image |
Specifies the background image to be displayed at the specified location, or null() to remove a background image. |
Return Value
None.
Remarks
This method depends on process-specific BBjImage references, so it can only be called from the BBjMDI master process. In BBj 17 and higher, setBackgroundImageFile is available, and can be called from either the BBjMDI master process or from a BBjMDI client process.
Example
rem ' setBackgroundImage basis$ = System.getProperty("basis.BBjHome") addon$ = basis$ + "/barista/sys/images/" demos$ = basis$ + "/demos/images/" sysgui = unt open (sysgui)"X0" sysgui! = bbjapi().getSysGui() if argc > 1 and argv(1) = "client" then goto client mdi! = bbjapi().getMDI() title$ = "MDI setBackgroundImage" mdi!.createMDIWindow(50,50,1000,600,title$,$00090083$) mdi!.setCallback(mdi!.ON_CLOSE,"eoj") mdi!.addMenuBar() mdi!.enableMDIWindowMenu() mdi!.addStatusBar() mdi!.setBackColor(sysgui!.makeColor(160,160,160)) imagemanager! = sysgui!.getImageManager() image! = imagemanager!.loadImageFromFile(demos$+"bbj.png") mdi!.setBackgroundImage(BBjMDI.CENTER,image!) image! = imagemanager!.loadImageFromFile(addon$+"addon_logo_32.png") mdi!.setBackgroundImage(BBjMDI.NORTHWEST,image!) image! = imagemanager!.loadImageFromFile(addon$+"barista_about.png") mdi!.setBackgroundImage(BBjMDI.SOUTHEAST,image!) invoke = scall("bbj " + pgm(-2) + " - client &") if msgbox("Set desktop background image?",4+32+256)=6 then image! = javax.imageio.ImageIO.read(new java.net.URL(url$)) os! = new java.io.ByteArrayOutputStream() javax.imageio.ImageIO.write(image!,"png",os!) bytes! = os!.toByteArray() image! = imagemanager!.loadImageFromBytes(bytes!) mdi!.setBackgroundImage(BBjMDI.FILL,image!) endif rem ' To remove a background image: rem mdi!.setBackgroundImage(-1,null()) process_events client: print 'hide', window! = sysgui!.addWindow(100,50,50,200,100,"MDI Client",$00010083$,$$) window!.setCallback(window!.ON_CLOSE,"eoj") process_events eoj: release |
See Also
See the BBj Object Diagram for an illustration of the relationship between BBj Objects.