InfoHasAlpha example for Visual Basic
Dim RasterIO As New LEADRasterIO
Dim RasterProc As New LEADRasterProcess
RasterIO.Load LEADRasterView1.Raster, "c:\temp\1.jpg", 24, 1, 1 'load a 24-bit image
LEADRasterView2.Raster.Bitmap = LEADRasterView1.Raster.Bitmap
RasterProc.ColorRes LEADRasterView1.Raster, 8, 0, 0, 0 'just make it 8-bit
'now set an alpha channel
LEADRasterView1.Raster.BitmapAlpha = LEADRasterView2.Raster.Bitmap
'save and free
RasterIO.Save LEADRasterView1.Raster, "c:\temp\32.png", FILE_PNG, 32, 0, 0
LEADRasterView1.Raster.Bitmap = 0
LEADRasterView2.Raster.Bitmap = 0
MsgBox "Pause"
're-load
RasterIO.GetFileInfo LEADRasterView1.Raster, "c:\temp\32.png", 0, 0
If (RasterIO.InfoHasAlpha <> False) Then
RasterIO.Load LEADRasterView1.Raster, "c:\temp\32.png", 0, 1, 1
End If
LEADRasterView2.Raster.Bitmap = LEADRasterView1.Raster.BitmapAlpha