Image Constructor
- 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
Initializes a new instance of the Image class.
Syntax
Image()
Creates an empty instance of the Image class.
public Image();Public Sub New()Image(string, int)
Initializes a new image from the specified image file and filter.
public Image(string fileName, int filterIndex);Public Sub New(fileName As String, filterIndex As Integer)| Parameter | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| fileName | Specifies the name and the path of the file from which the image is loaded. | ||||||||||||||||||
| filterIndex | Specifies the index of the filter used to load the image. It is an index in the string returned through the ImageCollection.ImportFilters property starting with 1. Possible values are:
|
Image(System.Drawing.Image)
Initializes a new image from the specified System.Drawing.Image.
Only in TXTextControl.TextControl.ASP.SDK.
public Image(System.Drawing.Image image);Public Sub New(image As System.Drawing.Image)| Parameter | Description |
|---|---|
| image | Specifies a System.Drawing.Image object which is used to initialize the TXTextControl image. |
Image(MemoryStream)
Initializes a new image from the specified memory stream.
public Image(MemoryStream stream);Public Sub New(stream As MemoryStream)| Parameter | Description |
|---|---|
| stream | Specifies a memory stream from which the data for the TXTextControl image is read. |
Examples
The following example inserts and configures a named, accessible company logo.
TXTextControl.Image image = new() { FileName = @"Images\company-logo.png", Name = "CompanyLogo" };
textControl.Images.Add(image, -1);
textControl.Save("report-with-logo.docx", StreamType.WordprocessingML);Dim image As New TXTextControl.Image() With { .FileName = "Images\company-logo.png", .Name = "CompanyLogo" }
textControl.Images.Add(image, -1)
textControl.Save("report-with-logo.docx", StreamType.WordprocessingML)