Available in the LEADTOOLS Imaging toolkit. |
BitmapCompression example for Visual Basic
' This example toggles the bitmap’s compression
Dim oldSize As Long
oldSize = LEAD1.BitmapSize
If LEAD1.BitmapCompression = COMP_NONE Then
' Compress the bitmap
If LEAD1.BitmapBits = 24 Then
LEAD1.BitmapCompression = COMP_SUPER
ElseIf LEAD1.BitmapBits = 1 Then
LEAD1.BitmapCompression = COMP_RLE
End If
Else
' Bitmap is compressed. Uncompress it
LEAD1.BitmapCompression = COMP_NONE
End If
MsgBox "old Size = " + CStr(oldSize) + vbCr + "New Size = " + CStr(LEAD1.BitmapSize)