Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

PdfViewerControl.CreateBitmap(Int32, Int32) Method

Exports a PDF page to a bitmap image.

Namespace: DevExpress.Xpf.PdfViewer

Assembly: DevExpress.Xpf.PdfViewer.v24.2.dll

NuGet Package: DevExpress.Wpf.PdfViewer

#Declaration

public BitmapSource CreateBitmap(
    int index,
    int largestEdgeLength
)

#Parameters

Name Type Description
index Int32

An integer value, specifying the page number.

largestEdgeLength Int32

An integer value, specifying the length of the image’s largest dimension.

#Returns

Type Description
BitmapSource

A System.Windows.Media.Imaging.BitmapSource object.

#Remarks

The CreateBitmap method has two parameters: the converted page’s number and the length of the image’s largest dimension in pixels. The latter parameter determines the output image height for pages in the portrait orientation and width - for landscape pages.

You can reduce the output image size and memory consumption if you pass a smaller largestEdgeLength value to the CreateBitmap method. The document page will not be clipped when it is converted to bitmap. The page will be proportionally scaled so that the largest edge of the converted bitmap is equal to the largestEdgeLength value.

See Also