Previous Document Next Document
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

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 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.

Parameters
Description
FileName
Specifies the name of the document you are saving. 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
Identifies the image type being exported
This value returns cdrImageType. This parameter is optional, and its default value is cdrRGBColorImage (4).
Width
Sets the height of the bitmap, measured in document units
This parameter is optional, and its default value is 0.
Height
Sets the height of the bitmap, measured in document units
This parameter is optional, and its default value is 0.
ResolutionX
Specifies a 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 a 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 a value that indicates the appearance of a bitmap’s edges when it is exported.
The AntiAliasingType property returns a value of 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
Lets you specify 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.

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