GetDIB2 example for Visual Basic

'This example gets the image from LEADRasterView1 as a V5 DIB
    'and then loads the DIB into LEADRasterView2
    Dim MyDIB As Long

    'LEADRasterView1 has an image at this point
    MyDIB = LEADRasterView1.Raster.GetDIB2 (DIB_BITMAPV5HEADER)
    LEADrasterView2.Raster.SetDIB (MyDIB)

    'Free the DIB using the Windows API
    GlobalFree MyDIB