BBjHtmlView::getImage

Description

In BBj 16.0 and higher, this method returns a BBjImage corresponding to the contents of a BBjHtmlView control.

Syntax

Return Value

Method

BBjImage

getImage()

Parameters

None.

Return Value

Returns a BBjImage corresponding to the contents of the BBjHtmlView control.

Remarks

This method may not work in all BBjHtmlView clients. It can take a significant amount of time for a page to be fully rendered. For best results, this method should be invoked from an event handler for the ON_PAGE_LOADED event.

Example

rem ' BBjHtmlView::getImage
url$ = "http://www.basis.com"
url$ = "http://en.wikipedia.org"
sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
window! = sysgui!.addWindow(25,25,1000,600,"BBjHtmlView::getImage",$00090003$)
window!.setCallback(window!.ON_CLOSE,"eoj")
client = 0
if info(3,6)<>"5" then
   client = msgbox("BBjHtmlView Client",7+32+512,"BBjHtmlView","Swing","JavaFX","Chromium")
   switch client
      case 1; rem ' Swing
         print stbl("!OPTIONS","CHROMIUM_HTMLVIEW=FALSE",ERR=*NEXT)
         print stbl("!OPTIONS","JAVAFX_HTMLVIEW=FALSE",ERR=*NEXT)
         break
      case 2; rem ' JavaFX
         print stbl("!OPTIONS","CHROMIUM_HTMLVIEW=FALSE",ERR=*NEXT)
         print stbl("!OPTIONS","JAVAFX_HTMLVIEW=TRUE",ERR=*NEXT)
         break
      case 3; rem ' Chromium
         print stbl("!OPTIONS","CHROMIUM_HTMLVIEW=TRUE",ERR=*NEXT)
         print stbl("!OPTIONS","JAVAFX_HTMLVIEW=TRUE",ERR=*NEXT)
         break
   swend
endif
htmlview! = window!.addHtmlView(101,25,25,550,550,"")
htmlview!.setUrl(url$)
htmlview!.setCallback(htmlview!.ON_PAGE_LOADED,"page_loaded")
getImage! = window!.addButton(1,600,25,375,25,"BBjHtmlView::getImage")
getImage!.setCallback(getImage!.ON_BUTTON_PUSH,"getImage")
empty! = bbjapi().getSysGui().getImageManager().loadImageFromBytes("")
image! = window!.addImageCtrl(100,600,75,375,375,empty!)
title$ = htmlview!.getClientType()+" "+htmlview!.getClientVersion()
print title$
window!.setTitle("BBjHtmlView::getImage "+title$)
process_events
eoj:
release
page_loaded:
event! = sysgui!.getLastEvent()
print event!.getEventName()," ",event!.getUrl()
return
getImage:
image!.setImage(htmlview!.getImage())
return

See Also

BBjAPI

BBjSysGui

BBjControl

BBjWindow

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



______________________________________________________________________________________

Copyright BASIS International Ltd. BBj®, Visual PRO/5®, PRO/5®, and BBx® are registered trademarks.