GetImage Method
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. Core. SDK TXTextControl.from the private NuGet feed or Text Control Offline PackagesCore. dll
- Also in
TXTextControl.asTextControl. ASP. SDK TXTextControl.dll
Description
Gets an image of the page's contents.
Syntax
GetImage(Page.PageContent)
Gets an image of the page's contents as an enhanced metafile.
Only in TXTextControl.TextControl.ASP.SDK.
public Metafile GetImage(Page.PageContent contents);Public Function GetImage(contents As Page.PageContent) As Metafile| Parameter | Description |
|---|---|
| contents | Specifies the image's contents. It can be one or more of the values of the PageContent enumeration. |
GetImage(int, Page.PageContent)
Gets an image of the page's contents as a bitmap in screen resolution.
Only in TXTextControl.TextControl.ASP.SDK.
public Bitmap GetImage(int zoomFactor, Page.PageContent contents);Public Function GetImage(zoomFactor As Integer, contents As Page.PageContent) As Bitmap| Parameter | Description |
|---|---|
| zoomFactor | Specifies a zooming factor in percent. |
| contents | Specifies the image's contents. It can be one or more of the values of the PageContent enumeration. |
GetImage(Page.PageContent, int)
Gets an image of the page's contents as a string in Scalable Vector Graphics (SVG) format. 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(Page.PageContent contents, int iMaxImageResolution);Public Function GetImage(contents As Page.PageContent, iMaxImageResolution As Integer) As String| Parameter | Description |
|---|---|
| contents | Specifies the image's contents. It can be one or more of the values of the PageContent enumeration. |
| 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. |
Examples
The following example works with the first laid-out page of a short report by using Page.GetImage.
textControl.Text = "Quarterly results\nRevenue increased by 12%.";
Page page = textControl.GetPages()[1];
var result = page.GetImage(Page.PageContent.Background, 10);
Console.WriteLine($"Get Image result: {result}");
page.Select();textControl.Text = "Quarterly results" & vbCrLf & "Revenue increased by 12%."
Dim page As Page = textControl.GetPages().Item(1)
Dim result = page.GetImage(Page.PageContent.Background, 10)
Console.WriteLine($"Get Image result: {result}")
page.Select()Remarks
When an SVG is added to the TextControl's ImageCollection, its original content is embedded unchanged in the SVG created with the GetImage method. This includes all script data that was part of the added SVG image.