PdfRenderer.Page.Render Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Render(Bitmap, Rect, Matrix, PdfRenderMode) |
Renders a page to a bitmap. |
Render(Bitmap, Rect, Matrix, RenderParams) |
Renders a page to a bitmap. |
Render(Bitmap, Rect, Matrix, PdfRenderMode)
Renders a page to a bitmap.
[Android.Runtime.Register("render", "(Landroid/graphics/Bitmap;Landroid/graphics/Rect;Landroid/graphics/Matrix;I)V", "")]
public void Render (Android.Graphics.Bitmap destination, Android.Graphics.Rect? destClip, Android.Graphics.Matrix? transform, Android.Graphics.Pdf.PdfRenderMode renderMode);
[<Android.Runtime.Register("render", "(Landroid/graphics/Bitmap;Landroid/graphics/Rect;Landroid/graphics/Matrix;I)V", "")>]
member this.Render : Android.Graphics.Bitmap * Android.Graphics.Rect * Android.Graphics.Matrix * Android.Graphics.Pdf.PdfRenderMode -> unit
Parameters
- destination
- Bitmap
Destination bitmap to which to render.
- destClip
- Rect
Optional clip in the bitmap bounds.
- transform
- Matrix
Optional transformation to apply when rendering.
- renderMode
- PdfRenderMode
The render mode.
- Attributes
Remarks
Renders a page to a bitmap.
You may optionally specify a rectangular clip in the bitmap bounds. No rendering outside the clip will be performed, hence it is your responsibility to initialize the bitmap outside the clip.
You may optionally specify a matrix to transform the content from page coordinates which are in points (1/72") to bitmap coordinates which are in pixels. If this matrix is not provided this method will apply a transformation that will fit the whole page to the destination clip if provided or the destination bitmap if no clip is provided.
The clip and transformation are useful for implementing tile rendering where the destination bitmap contains a portion of the image, for example when zooming. Another useful application is for printing where the size of the bitmap holding the page is too large and a client can render the page in stripes.
<strong>Note: </strong> The destination bitmap format must be Config#ARGB_8888 ARGB
.
<strong>Note: </strong> The optional transformation matrix must be affine as per android.graphics.Matrix#isAffine() Matrix.isAffine()
. Hence, you can specify rotation, scaling, translation but not a perspective transformation.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
Render(Bitmap, Rect, Matrix, RenderParams)
Renders a page to a bitmap.
[Android.Runtime.Register("render", "(Landroid/graphics/Bitmap;Landroid/graphics/Rect;Landroid/graphics/Matrix;Landroid/graphics/pdf/RenderParams;)V", "", ApiSince=35)]
public void Render (Android.Graphics.Bitmap destination, Android.Graphics.Rect? destClip, Android.Graphics.Matrix? transform, Android.Graphics.Pdf.RenderParams params);
[<Android.Runtime.Register("render", "(Landroid/graphics/Bitmap;Landroid/graphics/Rect;Landroid/graphics/Matrix;Landroid/graphics/pdf/RenderParams;)V", "", ApiSince=35)>]
member this.Render : Android.Graphics.Bitmap * Android.Graphics.Rect * Android.Graphics.Matrix * Android.Graphics.Pdf.RenderParams -> unit
Parameters
- destination
- Bitmap
Destination bitmap to write to.
- destClip
- Rect
If null, default zoom is applied. In case the value is non-null, the value specifies the top top-left corner of the tile.
- transform
- Matrix
Applied to scale the bitmap up/down from default 1/72 points.
- params
- RenderParams
Render params for the changing display mode and/or annotations.
- Attributes
Remarks
Renders a page to a bitmap. In case of default zoom, the Bitmap
dimensions will be equal to the page dimensions. In this case, Rect
parameter can be null.
In case of zoom, the Rect
parameter needs to be specified which represents the offset from top and left for tile generation purposes. In this case, the Bitmap
dimensions should be equal to the tile dimensions.
<strong>Note:</strong> The method will take care of closing the bitmap. Should be invoked on the android.annotation.WorkerThread
as it is long-running task.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.