BitmapCompression example for Visual Basic
' This example toggles the bitmap's compression
Dim oldSize As Long
oldSize = LEADRasterView1.Raster.BitmapSize
If LEADRasterView1.Raster.BitmapCompression = COMP_NONE Then
' Compress the bitmap
If LEADRasterView1.Raster.BitmapBits = 24 Then
RasterProc.SetBitmapCompression LEADRasterView1.Raster, COMP_SUPER
ElseIf LEADRasterView1.Raster.BitmapBits = 1 Then
RasterProc.SetBitmapCompression LEADRasterView1.Raster, COMP_RLE
End If
Else
' Bitmap is compressed. Uncompress it
RasterProc.SetBitmapCompression LEADRasterView1.Raster, COMP_NONE
End If
MsgBox "old Size = " + CStr(oldSize) + vbCr + "New Size = " + CStr(LEADRasterView1.Raster.BitmapSize)