Unit

Unit class

Module: aspose_barcode.generation.unit

Specifies the size value in different units (Pixel, Inches, etc.). This sample shows how to create and save a BarCode image.

Constructors

NameDescription
init

Methods

NameReturn TypeStaticDescription
eqboolNoDetermines whether this instance and a specified object, which must also be a Unit object, have the same value.
hashintNoReturns the hash code for the current instance.
strstrNoReturns a human-readable string representation of this Unit.

Properties

NameTypeDescription
documentfloatGets size value in document units.
inchesfloatGets size value in inches.
millimetersfloatGets size value in millimeters.
pixelsfloatGets size value in pixels.
pointfloatGets size value in point.

Unit Constructor

__init__(self, Union[Unit, Any] source)
ParameterTypeDescription
sourceUnion[Unit, Any]

Unit.eq

__eq__(self, Optional[Unit] other) -> bool

Determines whether this instance and a specified object, which must also be a Unit object, have the same value.

ParameterTypeDescription
otherOptional[Unit]The Unit to compare to this instance.

Return Type: bool — True if other is a Unit and its value is the same as this instance, otherwise False. If other is None, the method returns false.

Unit.hash

__hash__(self) -> int

Returns the hash code for the current instance.

Return Type: int — A hash code for the current object.

Unit.str

__str__(self) -> str

Returns a human-readable string representation of this Unit.

Return Type: str — A string that represents this Unit.

Unit.document

Type: float

Gets size value in document units.

Sets size value in document units.

ParameterTypeDescription
valuefloat

Unit.inches

Type: float

Gets size value in inches.

Sets size value in inches.

ParameterTypeDescription
valuefloat

Unit.millimeters

Type: float

Gets size value in millimeters.

Sets size value in millimeters.

ParameterTypeDescription
valuefloat

Unit.pixels

Type: float

Gets size value in pixels.

Sets size value in pixels.

ParameterTypeDescription
valuefloat

Unit.point

Type: float

Gets size value in point.

Sets size value in point.

ParameterTypeDescription
valuefloat