Previous Document Next Document

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


Bitmap.ConvertToPaletted

Sub ConvertToPaletted(PaletteType As cdrImagePaletteType, [DitherType As cdrDitherType = cdrDitherNone], [DitherIntensity As Long = 100], [Smoothing As Long], [NumColors As Long = 256], [ColorSensitive As Boolean = False], [TargetColor As Long = 16777215], [Importance As Long = 500], [Lightness As Long = 300], [ToleranceA As Long = 300], [ToleranceB As Long = 100], [Palette As Variant])

Description

Member of Bitmap

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

Parameter
Description
PaletteType
Specifies the palette to apply
DitherType
Specifies the type of dithering to apply. This parameter is optional, and its default value is cdrDitherNone (0).
DitherIntensity
Specifies the intensity of the dithering. This parameter is optional, and its default value is 100.
Smoothing
Specifies the type of smoothing to apply. This parameter is optional, and its default value is 0.
NumColors
Specifies the maximum number of colors in the optimized image. The PaletteType must be optimized for this option to be applied. This parameter is optional, and its default value is 256.
ColorSensitive
Specifies whether color sensitivity is applied. This parameter is optional, and its default value is False.
TargetColor
Specifies the color to which the color sensitivity is applied. This parameter is optional, and its default value is 16777215.
Importance
Specifies the emphasis of the sensitivity of the target color. The TargetColor must be specified for this option to be applied. This parameter is optional, and its default value is 500.
Lightness
Specifies the lightness of the range sensitivity. This parameter is optional, and its default value is 300.
ToleranceA
Specifies the tolerance of the range sensitivity on the green-red axis. This parameter is optional, and its default value is 300.
ToleranceB
Specifies the tolerance of the range sensitivity on the blue-yellow axis. This parameter is optional, and its default value is 100.
Palette
Specifies a custom palette. This parameter is optional.

VBA example

The following VBA example converts all bitmaps on the active page to the Optimized palette.

Sub Test()
 Dim s As Shape
 For Each s In ActivePage.Shapes
  If s.Type = cdrBitmapShape Then
   If s.Bitmap.Mode <> cdrPalettedImage Then
    s.Bitmap.ConvertToPaletted cdrPaletteOptimized, cdrDitherNone, , 5
   End If
  End If
 Next s
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.