Previous Document Next Document

Object Model Reference : Classes : B : Bitmap : Methods : Bitmap.ConvertToPaletted2


Bitmap.ConvertToPaletted2

Sub ConvertToPaletted2([Options As StructPaletteOptions])

Description

Member of Bitmap

The ConvertToPaletted2 method converts the bitmap to a specific palette using the specified parameters.

Parameter
Description
Options
Specifies a set of options to apply. This parameter is optional, and its default value is Nothing.

VBA example

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

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.