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