Previous Document Next Document

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


Bitmap.ConvertToBW

Sub ConvertToBW(RenderType As cdrRenderType, [Intensity As Long = 100], [Threshold As Long = 128], [Halftone As cdrHalftoneType = cdrHalftoneSquare], [HalftoneAngle As Long = 45], [HalftoneSize As Long])

Description

Member of Bitmap

The ConvertToBW method converts the bitmap to the black and white color mode.

Parameter
Description
RenderType
Specifies the type of conversion
Intensity
Specifies the intensity of the applied color. This parameter is optional, and its default value is 100.
Threshold
Specifies the tolerance level for tonal variation for a line art conversion. This parameter is optional, and its default value is 128.
Halftone
Specifies a halftone screen. This parameter is optional, and its default value is cdrHalftoneSquare (0).
HalftoneAngle
Specifies the halftone angle. This parameter is optional, and its default value is 45.
HalftoneSize
Specifies the lines per unit for a halftone conversion. This parameter is optional, and its default value is 0.

VBA example

The following VBA example converts all bitmaps on the active page to the black-and-white color mode.

Sub Test()
 Dim s As Shape
 For Each s In ActivePage.Shapes
  If s.Type = cdrBitmapShape Then
   If s.Bitmap.Mode = cdrRGBColorImage Then
    s.Bitmap.ConvertToBW cdrRenderLineArt, , 97
   End If
  End If
 Next s
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.