Class Unit

Class Unit

Namespace: Aspose.BarCode.Generation
Assembly: Aspose.BarCode.dll (25.4.0)

Specifies the size value in different units (Pixel, Inches, etc.).

public sealed class Unit

Inheritance

object Unit

Inherited Members

object.GetType() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Examples

This sample shows how to create and save a BarCode image.

using (BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.Code128))
  {
      generator.Parameters.Barcode.BarHeight.Millimeters = 10;
      generator.Save("test.png");
  }

Properties

Document

Gets or sets size value in document units.

public float Document { get; set; }

Property Value

float

Inches

Gets or sets size value in inches.

public float Inches { get; set; }

Property Value

float

Millimeters

Gets or sets size value in millimeters.

public float Millimeters { get; set; }

Property Value

float

Pixels

Gets or sets size value in pixels.

[XmlSerialization(Type = XmlSerializationType.Element)]
public float Pixels { get; set; }

Property Value

float

Point

Gets or sets size value in point.

public float Point { get; set; }

Property Value

float

Resolution

Resolution

[XmlSerialization(Type = XmlSerializationType.Element)]
public float Resolution { get; }

Property Value

float

Methods

Equals(object)

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

public override bool Equals(object obj)

Parameters

obj object

The Aspose.BarCode.Generation.Unit to compare to this instance.

Returns

bool

true if obj is a Aspose.BarCode.Generation.Unit and its value is the same as this instance; otherwise, false. If obj is null, the method returns false.

GetHashCode()

Returns the hash code for this object.

public override int GetHashCode()

Returns

int

A 32-bit signed integer hash code.

ToString()

Returns a human-readable string representation of this Aspose.BarCode.Generation.Unit.

public override string ToString()

Returns

string

A string that represents this Aspose.BarCode.Generation.Unit.

 English