Available in the LEADTOOLS Imaging toolkit. |
InfoHasAlpha example for Visual Basic
LEAD1.Load "c:\temp\1.jpg", 24, 1, 1 'load a 24-bit image
LEAD2.Bitmap = LEAD1.Bitmap
LEAD2.ColorRes 8, 0, 0, 0 'just make it 8-bit
'now set an alpha channel
LEAD1.BitmapAlpha = LEAD2.Bitmap
'save and free
LEAD1.Save "c:\temp\32.png", FILE_PNG, 32, 0, 0
LEAD1.Bitmap = 0
LEAD2.Bitmap = 0
MsgBox "Pause"
're-load
LEAD1.GetFileInfo "c:\temp\32.png", 0, 0
If (LEAD1.InfoHasAlpha <> False) Then
LEAD1.Load "c:\temp\32.png", 0, 1, 1
End If
LEAD2.Bitmap = LEAD1.BitmapAlpha