SaveLayers example for Visual Basic
' Save all the extra bitmaps in the bitmap list as layers
RasterIO.SaveLayers= True
For i = 1 To LEADRasterView1.Raster.BitmapListCount - 1
' reset the layer info so all the layers are saved from 0,0 offset
RasterIO.LayerLeft (LEADRasterView1.Raster, i) = 0
RasterIO.LayerTop(LEADRasterView1.Raster, i) = 0
RasterIO.LayerBlendModeKey(LEADRasterView1.Raster, i) = "dark"
RasterIO.LayerClipping(LEADRasterView1.Raster, i) = 0
RasterIO.LayerOpacity(LEADRasterView1.Raster, i) = 40
Dim Raster2 As New LEADRaster
Raster2.Bitmap = 0
RasterIO.SetLayerMaskBitmap LEADRasterView1.Raster, Raster2, i
Next
' set the active bitmap to be the first in the list
RasterIO.Save LEADRasterView1.Raster, "c:\temp\layers.psd", FILE_PSD, 0, 0, SAVE_OVERWRITE