Class ImageDefinition
Represents an image definition.
Implements
Inherited Members
Namespace: netDxf.Objects
Assembly: CADability.dll
Syntax
public class ImageDefinition : TableObject, IHasXData, ICloneable, IComparable, IComparable<TableObject>, IEquatable<TableObject>
Constructors
| Improve this Doc View SourceImageDefinition(String)
Initializes a new instance of the ImageDefinition class.
Declaration
public ImageDefinition(string file)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | file | Image file name with full or relative path. |
Remarks
The name of the file without extension will be used as the name of the image definition.
Supported image formats: BMP, JPG, PNG, TIFF.
Even thought AutoCAD supports more image formats, this constructor is restricted to the ones the net framework supports in common with AutoCAD.
Use the generic constructor instead.
Note (this is from the ACAD docs): AutoCAD 2000, AutoCAD LT 2000, and later releases do not support LZW-compressed TIFF files,
with the exception of English language versions sold in the US and Canada.
If you have TIFF files that were created using LZW compression and want to insert them into a drawing
you must save the TIFF files with LZW compression disabled.
ImageDefinition(String, Int32, Double, Int32, Double, ImageResolutionUnits)
Initializes a new instance of the ImageDefinition class.
Declaration
public ImageDefinition(string file, int width, double horizontalResolution, int height, double verticalResolution, ImageResolutionUnits units)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | file | Image file name with full or relative path. |
| System.Int32 | width | Image width in pixels. |
| System.Double | horizontalResolution | Image horizontal resolution in pixels. |
| System.Int32 | height | Image height in pixels. |
| System.Double | verticalResolution | Image vertical resolution in pixels. |
| ImageResolutionUnits | units | Image resolution units. |
Remarks
The name of the file without extension will be used as the name of the image definition.
This is a generic constructor for all image formats supported by AutoCAD, note that not all AutoCAD versions support the same image formats.
Note (this is from the ACAD docs): AutoCAD 2000, AutoCAD LT 2000, and later releases do not support LZW-compressed TIFF files,
with the exception of English language versions sold in the US and Canada.
If you have TIFF files that were created using LZW compression and want to insert them into a drawing
you must save the TIFF files with LZW compression disabled.
ImageDefinition(String, String)
Initializes a new instance of the ImageDefinition class.
Declaration
public ImageDefinition(string name, string file)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Image definition name. |
| System.String | file | Image file name with full or relative path. |
Remarks
The name assigned to the image definition must be unique.
Supported image formats: BMP, JPG, PNG, TIFF.
Even thought AutoCAD supports more image formats, this constructor is restricted to the ones the .net library supports in common with AutoCAD.
Use the generic constructor instead.
Note (this is from the ACAD docs): AutoCAD 2000, AutoCAD LT 2000, and later releases do not support LZW-compressed TIFF files,
with the exception of English language versions sold in the US and Canada.
If you have TIFF files that were created using LZW compression and want to insert them into a drawing
you must save the TIFF files with LZW compression disabled.
ImageDefinition(String, String, Int32, Double, Int32, Double, ImageResolutionUnits)
Initializes a new instance of the ImageDefinition class.
Declaration
public ImageDefinition(string name, string file, int width, double horizontalResolution, int height, double verticalResolution, ImageResolutionUnits units)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Image definition name. |
| System.String | file | Image file name with full or relative path. |
| System.Int32 | width | Image width in pixels. |
| System.Double | horizontalResolution | Image horizontal resolution in pixels. |
| System.Int32 | height | Image height in pixels. |
| System.Double | verticalResolution | Image vertical resolution in pixels. |
| ImageResolutionUnits | units | Image resolution units. |
Remarks
The name assigned to the image definition must be unique.
This is a generic constructor for all image formats supported by AutoCAD, note that not all AutoCAD versions support the same image formats.
Note (this is from the ACAD docs): AutoCAD 2000, AutoCAD LT 2000, and later releases do not support LZW-compressed TIFF files,
with the exception of English language versions sold in the US and Canada.
If you have TIFF files that were created using LZW compression and want to insert them into a drawing
you must save the TIFF files with LZW compression disabled.
Properties
| Improve this Doc View SourceFile
Gets the image file.
Declaration
public string File { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Height
Gets the image height in pixels.
Declaration
public int Height { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
HorizontalResolution
Gets the image horizontal resolution in pixels per unit.
Declaration
public double HorizontalResolution { get; }
Property Value
| Type | Description |
|---|---|
| System.Double |
Owner
Gets the owner of the actual image definition.
Declaration
public ImageDefinitions Owner { get; }
Property Value
| Type | Description |
|---|---|
| ImageDefinitions |
ResolutionUnits
Gets or sets the image resolution units.
Declaration
public ImageResolutionUnits ResolutionUnits { get; set; }
Property Value
| Type | Description |
|---|---|
| ImageResolutionUnits |
VerticalResolution
Gets the image vertical resolution in pixels per unit.
Declaration
public double VerticalResolution { get; }
Property Value
| Type | Description |
|---|---|
| System.Double |
Width
Gets the image width in pixels.
Declaration
public int Width { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Methods
| Improve this Doc View SourceClone()
Creates a new ImageDefinition that is a copy of the current instance.
Declaration
public override object Clone()
Returns
| Type | Description |
|---|---|
| System.Object | A new ImageDefinition that is a copy of this instance. |
Overrides
| Improve this Doc View SourceClone(String)
Creates a new ImageDefinition that is a copy of the current instance.
Declaration
public override TableObject Clone(string newName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | newName | ImageDefinition name of the copy. |
Returns
| Type | Description |
|---|---|
| TableObject | A new ImageDefinition that is a copy of this instance. |