ScreenCapture


Description of Control

It generates a screenshot of a web page quickly and easily.
The user control web ScreenCapture allows to generate a screenshot of a web page, returning the result in image format.
This facilitates, for example, generating PDF reports of a dashboard with graphics and having filters applied to the data that are very complex to print later in a GeneXus report. 

Compatibility

Web

Using the control 

Open Extensibility Catalog, and go to the WEB section through the left side menu. 
Select the ScreenCapturecontrol. Follow the steps of the Wizard

Create a Web Panel, drag from the toolbox the control to the WP form. 

Events 

In execution, the capture can be generated by calling the GetScreen control method, then the example that the control adds is shown:
 
Event 'ScreenCapture'
    ScreenCapture1.GetScreen()
Endevent
 
When the control finishes generating the capture, it calls the event OnImageCapture, passing it in the Data property the generated file in png format in a base64 string, which can be loaded in a blob variable, to then use it, as shown below:
 

Event scaScreenCapture1.OnImageCapture
    &string = scaScreenCapture1.Data
    &PictureBlob.FromBase64String(&string)
    addImageToDb.Call(&PictureBlob)
EndEvent