Class Transparency
Represents the transparency of a layer or an entity.
Inheritance
Inherited Members
Namespace: netDxf
Assembly: CADability.dll
Syntax
public class Transparency : ICloneable, IEquatable<Transparency>
Remarks
When the transparency of an entity is ByLayer the code 440 will not appear in the dxf, but for comparison purposes the ByLayer transparency is assigned a value of -1.
Constructors
| Improve this Doc View SourceTransparency()
Initializes a new instance of the Transparency class.
Declaration
public Transparency()
Transparency(Int16)
Initializes a new instance of the Transparency class.
Declaration
public Transparency(short value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int16 | value | Alpha value range from 0 to 90. |
Remarks
Accepted transparency values range from 0 (opaque) to 90 (almost transparent), the reserved values -1 and 100 represents ByLayer and ByBlock transparency.
Properties
| Improve this Doc View SourceByBlock
Gets the ByBlock transparency.
Declaration
public static Transparency ByBlock { get; }
Property Value
| Type | Description |
|---|---|
| Transparency |
ByLayer
Gets the ByLayer transparency.
Declaration
public static Transparency ByLayer { get; }
Property Value
| Type | Description |
|---|---|
| Transparency |
IsByBlock
Defines if the transparency is defined by block.
Declaration
public bool IsByBlock { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsByLayer
Defines if the transparency is defined by layer.
Declaration
public bool IsByLayer { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Value
Gets or sets the transparency value range from 0 to 90.
Declaration
public short Value { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int16 |
Remarks
Accepted transparency values range from 0 to 90, the reserved values -1 and 100 represents ByLayer and ByBlock.
Methods
| Improve this Doc View SourceClone()
Creates a new transparency that is a copy of the current instance.
Declaration
public object Clone()
Returns
| Type | Description |
|---|---|
| System.Object | A new transparency that is a copy of this instance. |
Equals(Transparency)
Check if the components of two transparencies are equal.
Declaration
public bool Equals(Transparency other)
Parameters
| Type | Name | Description |
|---|---|---|
| Transparency | other | Another transparency to compare to. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if their indexes are equal or false in any other case. |
FromAlphaValue(Int32)
Gets the Transparency object from a transparency value.
Declaration
public static Transparency FromAlphaValue(int value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | value | A transparency value. |
Returns
| Type | Description |
|---|---|
| Transparency |
ToAlphaValue(Transparency)
Gets the transparency value from a Transparency object.
Declaration
public static int ToAlphaValue(Transparency transparency)
Parameters
| Type | Name | Description |
|---|---|---|
| Transparency | transparency | A Transparency. |
Returns
| Type | Description |
|---|---|
| System.Int32 | A transparency value. |
ToString()
Converts the value of this instance to its equivalent string representation.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| System.String | The string representation. |