API Documentation > CorelDRAW > 2025-v26 > Bitmap > IVGBitmap
Bitmap.ConvertToPaletted2 method
Converts the bitmap to a paletted image using the specified parameters
Syntax:
Sub ConvertToPaletted2(Optional ByVal Options As StructPaletteOptions = Nothing)
Parameters:
Name Type Description
Options
Specifies a set of options to apply.
Remarks:
The ConvertToPaletted2 method converts the bitmap to a specific palette using the specified parameters.
Examples:
The following VBA example converts all bitmaps on the active page to a paletted bitmap.
Sub Test()
Dim s As Shape
Dim Pal As StructPaletteOptions
Set Pal = CreateStructPaletteOptions
With Pal
  .DitherType = cdrDitherNone
  .NumColors = 256
  .Smoothing = 5
  .PaletteType = cdrPaletteOptimized
End With
For Each s In ActivePage.Shapes
  If s.Type = cdrBitmapShape Then

 If s.Bitmap.Mode <> cdrPalettedImage Then


s.Bitmap.ConvertToPaletted2 Pal

 End If
  End If
Next s 
End Sub