Previous Document Next Document

Object Model Reference : Classes : D : Document : Methods : Document.ExportBitmap


Document.ExportBitmap

Function ExportBitmap(FileName As String, Filter As cdrFilter, [Range As cdrExportRange = cdrCurrentPage], [ImageType As cdrImageType = cdrRGBColorImage], [Width As Long], [Height As Long], [ResolutionX As Long = 72], [ResolutionY As Long = 72], [AntiAliasingType As cdrAntiAliasingType = cdrNormalAntiAliasing], [Dithered As Boolean = False], [Transparent As Boolean = False], [UseColorProfile As Boolean = True], [MaintainLayers As Boolean = False], [Compression As cdrCompressionType = cdrCompressionNone (0)], [PaletteOptions As StructPaletteOptions], [ExportArea As Rect]) As ExportFilter

Description

Member of Document

The ExportBitmap method exports the document to another file format and returns an ExportFilter object. This function uses the StructPaletteOptions object to specify image conversion parameters.

The ExportBitmap method is essentially equivalent to the Document.ExportEx method, except that the parameters specified as part of StructExportOptions in the call to ExportEx are specified as “in-line” for the call to ExportBitmap. It is more convenient for exporting bitmap images; however, ExportBitmap can still be used to export vector format, if desired.

Parameter
Description
FileName
Specifies the filename of the document. It becomes the Name of the document.
Filter
Specifies the filter that is used when saving objects. A filter translates digital information from one form to another. Import/export filters convert files from one format to another. When you select a file format in the Export dialog box of CorelDRAW, you automatically activate the appropriate filter application to perform the translation.
The Filter parameter returns a value of cdrFilter.
Range
Specifies the pages that are exported. You have the option of exporting all or several pages in a document, a single page in a document, or a selection of objects within a document.
The Range parameter returns a value of cdrExportRange. This parameter is optional, and its default value is cdrCurrentPage (1).
ImageType
Specifies the image type being exported
This value returns cdrImageType. This parameter is optional, and its default value is cdrRGBColorImage (4).
Width
Specifies the height of the bitmap, measured in document units. This parameter is optional, and its default value is 0.
Height
Specifies the height of the bitmap, measured in document units. This parameter is optional, and its default value is 0.
ResolutionX
Specifies the numerical value that indicates the horizontal resolution level of an image that is exported. This parameter is optional, and its default value is 72.
ResolutionY
Specifies the numerical value that indicates the vertical resolution level of an image that is exported. This parameter is optional, and its default value is 72.
AntiAliasingType
Specifies the value that indicates the appearance of a bitmap’s edges when it is exported, and returns cdrAntiAliasingType. This parameter is optional, and its default value is cdrNormalAntiAliasing (1).
Dithered
Specifies whether the image is dithered when exported. This parameter is optional, and its default value is False.
Transparent
Specifies the transparency of the image. This parameter is optional, and its default value is False.
UseColorProfile
Specifies whether to use the color profile when exporting the image. This parameter is optional, and its default value is True.
MaintainLayers
Specifies whether to maintain layers. This parameter is optional, and its default value is False.
Compression
Specifies the type of compression to apply. This parameter is optional, and its default value is cdrCompressionNone (0).
PaletteOptions
Specifies the set of options to apply when exporting to a paletted bitmap. This parameter is optional, and its default value is Nothing.
ExportArea
Specifies the export area. This parameter is optional, and its default value is Nothing.

VBA example

The following VBA example exports the new document to JPEG.

Sub Test()
 Dim d As Document
 Dim s As Shape
 Dim Filter As ExportFilter
 Set d = CreateDocument
 Set s = d.ActiveLayer.CreateEllipse2(4, 5, 2)
 s.Fill.ApplyFountainFill CreateRGBColor(255, 0, 0), CreateRGBColor(0, 0, 0)
 Set Filter = d.ExportBitmap("C:\Temp\Doc.jpeg", cdrJPEG, cdrCurrentPage, _
  cdrRGBColorImage, 0, 0, 72, 72)
 With Filter
  .Compression = 80
  .Optimized = True
  .Smoothing = 50
  .SubFormat = 1
  .Progressive = False
  .Finish
 End With
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.