ClipboardCopy Example VB

This example copies the area bound by a user-drawn selection rectangle to a new page.

Private Sub cmdClipCopy_Click()
    'Global blnIsRectangle As Boolean
        
    'The value of blnIsRectangle is set in the
    'SelectionRectDrawn event
    If blnIsRectangle = False Then
        MsgBox "No rectangle drawn", vbExclamation
        Exit Sub
    End If
    
    'If no parameters specified will copy area bounded
    'by rectangle
    ImgEdit1.ClipboardCopy
    'Create 8 1/2 X 11 black and white 300 dpi image
    ImgEdit1.DisplayBlankImage 2550, 3300, 300, 300, wiPageTypeBW
    
    'Reset blnIsRectangle
    blnIsRectangle = False
    
    'Paste data to new image, call CompletePaste to commit
    'the paste operation
    ImgEdit1.ClipboardPaste
    ImgEdit1.CompletePaste
End Sub