Previous Document Next Document
Bitmap.ConvertToPaletted2

Sub ConvertToPaletted2([Options As StructPaletteOptions])

Member of Bitmap

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

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

The following code 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 2007 Corel Corporation. All rights reserved.