API Documentation > CorelDRAW > 2025-v26 > Document > IVGDocument
Document.ExportBitmap method
Exports a document to a supported raster file format
Syntax:
Function ExportBitmap(ByVal FileName As String, ByVal Filter As cdrFilter, Optional ByVal Range As cdrExportRange = cdrCurrentPage, Optional ByVal ImageType As cdrImageType = cdrRGBColorImage, Optional ByVal Width As Long = 0, Optional ByVal Height As Long = 0, Optional ByVal ResolutionX As Long = 72, Optional ByVal ResolutionY As Long = 72, Optional ByVal AntiAliasingType As cdrAntiAliasingType = cdrNormalAntiAliasing, Optional ByVal Dithered As Boolean = False, Optional ByVal Transparent As Boolean = False, Optional ByVal UseColorProfile As Boolean = True, Optional ByVal MaintainLayers As Boolean = False, Optional ByVal Compression As cdrCompressionType = cdrCompressionNone, Optional ByVal PaletteOptions As StructPaletteOptions = Nothing, Optional ByVal ExportArea As Rect = Nothing) As ExportFilter
Parameters:
Name Type Description
FileName
String
Filter
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.
ImageType
Specifies the image type being exported This value returns cdrImageType.
Width
Long
Specifies the height of the bitmap, measured in document units.
Height
Long
Specifies the height of the bitmap, measured in document units.
ResolutionX
Long
Specifies the numerical value that indicates the horizontal resolution level of an image that is exported.
ResolutionY
Long
Specifies the numerical value that indicates the vertical resolution level of an image that is exported.
AntiAliasingType
Specifies the value that indicates the appearance of a bitmap's edges when it is exported, and returns cdrAntiAliasingType.
Dithered
Boolean
Specifies whether the image is dithered when exported.
Transparent
Boolean
Specifies the transparency of the image.
UseColorProfile
Boolean
Specifies whether to use the color profile when exporting the image.
MaintainLayers
Boolean
Specifies whether to maintain layers.
Compression
Specifies the type of compression to apply.
PaletteOptions
Specifies the set of options to apply when exporting to a paletted bitmap.
ExportArea
Specifies the export area.
Remarks:
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.
Examples:
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