DDB example for Visual Basic

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

Dim MyFlags As RasterCopyConstants
Dim RasterProc As New LEADRasterProcess
Dim MyDC As Long
Dim MyDDB As Long
Dim MyPalette As Long
MousePointer = 11 ' hourglass
MyFlags = COPY_EMPTY + COPY_DDB + 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
MyDC = LEADRasterView2.GetClientDC
MyDDB = LEADRasterView2.Raster.GetDDB(MyDC)
MyPalette = LEADRasterView2.GetPalette(MyDC)
LEADRasterView1.Raster.SetDDB MyDC, MyDDB, MyPalette
LEADRasterView1.ForceRepaint
LEADRasterView2.ReleaseClientDC
MousePointer = 0 ' default