DIB example for Visual Basic

This example copies the LEADRasterView1.Raster bitmap to the clipboard as a DIB. It pastes the DIB into LEADRasterView2 and reverses the image. It then gets a DIB from LEADRasterView2, sets the same DIB to LEADRasterView1, and repaints.

Dim RasterProc As New LEADRasterProcess
Dim MyFlags As RasterCopyConstants
Dim MyDib As Long
MousePointer = 11 ' hourglass
MyFlags = COPY_EMPTY + COPY_DIB + COPY_PALETTE
LEADRasterView1.Raster.Copy MyFlags
If (LEADRasterView2.Raster.Paste(PASTE_ISREADY) = 0) Then
    MsgBox ("Invalid data on the clipboard")
Else
    LEADRasterView2.Raster.Paste 0
End If
RasterProc.Reverse LEADRasterView2.Raster
MyDib = LEADRasterView2.Raster.GetDIB
LEADRasterView1.Raster.SetDIB MyDib
LEADRasterView1.ForceRepaint
MousePointer = 0 ' default