InfoLayers example for Visual Basic
' This example all the layers in a file to a bitmap list
RasterIO.GetFileInfo LEADRasterView1.Raster, "c:\temp\layers.psd", 0, 0
If RasterIO.InfoLayers = 0 Then
MsgBox "This file has no layers!"
Else
' load the first layer directly
RasterIO.LoadLayer LEADRasterView1.Raster, "c:\temp\layers.psd", 0, 0
' steal the bitmaps from the other object
LEADRasterView1.Raster.RefBitmap = True
For i = 1 To LEADRasterView1.Raster.InfoLayers - 1
' use a second control to load the other layers
' using LEAD1 to load the other layers would invalidate the bitmap list
RasterIO.LoadLayer LEADRasterView2.Raster, "c:\temp\layers.psd", 0, i
' append the layer to the bitmap list
LEADRasterView1.Raster.InsertBitmapListItem -1, LEADRasterView2.Raster.Bitmap
Next
End If