TX Text Control .NET Server

GetImage Method

Method|Introduced in 21.0
Namespace
TXTextControl.ServerVisualisation
Package
TXTextControl.TextControl.Core.SDK as TXTextControl.Server.Core.dll from the private NuGet feed or Text Control Offline Packages
Also in
TXTextControl.TextControl.ASP.SDK as TXTextControl.Server.dll

Description

Gets a part of a document as an image.

Syntax

GetImage()

Gets an image as a System.Drawing.Imaging.Bitmap.

Only in TXTextControl.TextControl.ASP.SDK.

public Bitmap GetImage();

GetImage(Rectangle)

Gets a clipping of the image as a System.Drawing.Imaging.Bitmap.

Only in TXTextControl.TextControl.ASP.SDK.

public Bitmap GetImage(Rectangle clipRectangle);
ParameterDescription
clipRectangle

Specifies the clipping, in pixels, relative to the top-left corner of the image, determined through the View.Location and View.Size properties.

GetImage(out byte[])

Gets an image as an array of bytes in Portable Network Graphics (PNG) format.

Only in TXTextControl.TextControl.ASP.SDK.

public bool GetImage(out byte[] arImage);
ParameterDescription
arImage

Specifies a byte array into which the data is saved. No memory needs to be allocated through the caller.

GetImage(out byte[], Rectangle)

Gets a clipping of an image as an array of bytes in Portable Network Graphics (PNG) format.

Only in TXTextControl.TextControl.ASP.SDK.

public bool GetImage(out byte[] arImage, Rectangle clipRectangle);
ParameterDescription
arImage

Specifies a byte array into which the data is saved. No memory needs to be allocated through the caller.

clipRectangle

Specifies the clipping, in pixels, relative to the top-left corner of the image, determined through the View.Location and View.Size properties.

GetImage(Rectangle, int, int, int)

Gets a clipping of an image as a string in Scalable Vector Graphics (.SVG) format. The clipping can be specified either through a rectangle or through a range of lines. All characters are contained with outline curve data that are cubic Bézier splines. Curve and line data coordinates are in twentieth of a point (twips). Images of all pixel-formats are embedded in Portable Network Graphics (PNG) format.

public string GetImage(Rectangle clipRectangle, int iFirstInvalidLine, int iLastInvalidLine, int iMaxImageResolution);
ParameterDescription
clipRectangle

Specifies the clipping, in pixels, relative to the top-left corner of the image, determined through the View.Location and View.Size properties.

iFirstInvalidLine

Specifies the first of a range of lines, one-based, determining the returned image. If this parameter in 0, the clipRectangle determines the image.

iLastInvalidLine

Specifies the last of a range of lines, one-based, determining the returned image. If this parameter in 0, the clipRectangle determines the image.

iMaxImageResolution

Specifies a maximum resolution value, in dots per inch, for images in pixel-formats. All of these images are embedded in Portable Network Graphics (PNG) format.

GetImage(Rectangle, Page.PageContent, int, int, int)

Only in TXTextControl.TextControl.ASP.SDK.

public Metafile GetImage(Rectangle clipRectangle, Page.PageContent content, int iFirstInvalidLine, int iLastInvalidLine, int iMaxImageResolution);

Examples

The following example retrieves image from the view.

var result = view.GetImage(new System.Drawing.Rectangle(20, 20, 600, 400));
Console.WriteLine($"Get Image result: {result}");