Reflection Desktop VBA Guide
Attachmate.Reflection.Objects Library / Attachmate.Reflection.Objects.Productivity Library / ScreenHistory Object / GetLiveScreenImage Method
Example
In This Topic
    GetLiveScreenImage Method
    In This Topic
    Returns the live screen as an image.
    Syntax
    expression.GetLiveScreenImage() As Byte()
    where expression is a variable that represents a ScreenHistory Object

    Return Value

    The live screen, in image format.
    Remarks
    This method can be used in conjunction with the ScreenChanged event to build a list of screen images. The returned image can be used in conjunction with the Productivity.OfficeTools CreateWordProcessingDocumentWithGraphicSet method, provided that the installed Office Suite and installed Office Tools adapter assembly support graphics in word-processing documents.

    The returned image is subject to currently configured privacy filters.

    Example
    This example saves the current screen as a bitmap.
    Sub SaveLiveImageBmp()
     
        On Error GoTo handler
     
        Dim fname As String
        Dim image() As Byte
     
        'Check or set the file name for the screen
        fname = InputBox("Save current Reflection screen image to:", , Environ("USERPROFILE") & "\My Documents\SessionScreen.bmp")
     
        'If no file name is set, exit
        If fname = "" Then Exit Sub
     
        'Get the screen image
        image = ThisIbmTerminal.Productivity.ScreenHistory.GetLiveScreenImage()
     
        'Open a file and write the image data to the file
        Open fname For Binary Access Write As #1
            Put #1, , image
        Close #1
     
        Exit Sub
     
    handler:
     
        MsgBox Err.Description
     
        Reset
     
    End Sub
    See Also