BBjWindow::getDrawPanelImage

Description

In BBj 11.0 and higher, this method returns a BBjWindow draw panel as a BBjImage.

Syntax

Return Value

Method

BBjImage

getDrawPanelImage()

Parameters

None.

Return Value

Returns the draw panel as a BBjImage.

Remarks

None.

Example

rem ' Signature capture sample

sysgui = unt

open (sysgui)"X0"

sysgui! = bbjapi().getSysGui()

x = 50, y = 50, w = 400, h = 250, title$ = "Signature"

window! = sysgui!.addWindow(x,y,w,h,title$,$00090883$,$$)

window!.setCallback(window!.ON_CLOSE,"eoj")

menu! = window!.addMenuBar()

file! = menu!.addMenu(100,"&File")

wipe! = file!.addMenuItem(101,"&New")

wipe!.setCallback(wipe!.ON_MENU_ITEM_SELECT,"wipe")

save! = file!.addMenuItem(102,"Save &As...")

save!.setCallback(wipe!.ON_MENU_ITEM_SELECT,"save")

exit! = file!.addMenuItem(199,"E&xit")

exit!.setCallback(exit!.ON_MENU_ITEM_SELECT,"eoj")

print (sysgui)'clear'(255,255,240)

print (sysgui)'pencolor'(0,0,255)

print (sysgui)'penwidth'(3)

print (sysgui)'scribble'(1)

print (sysgui)'track'(0)

format$ = "png"

process_events

eoj:

release

wipe:

  print (sysgui)'clear'

return

save:

  file$ = "Signature."+format$

  file$ = filesave("Save Signature",dsk("")+dir(""),file$,"")

  if pos("::"=file$) then return

  file! = new java.io.File(file$)

  file$ = file!.getCanonicalPath()

  path! = file!.getCanonicalPath().toLowerCase()

  if path!.endsWith(".gif") then format$ = "gif"

  if path!.endsWith(".png") then format$ = "png"

  if path!.endsWith(".jpg") then format$ = "jpg"

  if path!.endsWith(".jpeg") then format$ = "jpeg"

  image! = window!.getDrawPanelImage()

  image$ = image!.getBytes(format$,err=failed)

  image = unt

  open (image,mode="O_CREATE,O_TRUNC")file$

  writerecord (image)image$

  close (image)

  i = msgbox(file$,0,"Signature image file created")

return

failed:

  i = msgbox(errmes(-1),16,"Signature image file failed")

return

See Also

BBjAPI

BBjSysGui

BBjControl

BBjWindow

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