Package com.aspose.barcode.generation
Class Unit
java.lang.Object
com.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.BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.CODE_128); generator.getParameters().getBarcode().getBarHeight().setMillimeters(10); generator.save("test.png");
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermines whether this instance and a specified object, which must also be aUnitobject, have the same value.floatGets size value in document units.floatGets size value in inches.floatGets size value in millimeters.floatGets size value in pixels.floatgetPoint()Gets size value in point.floatinthashCode()Returns the hash code for this object.voidsetDocument(float value) Sets size value in document units.voidsetInches(float value) Sets size value in inches.voidsetMillimeters(float value) Sets size value in millimeters.voidsetPixels(float value) Sets size value in pixels.voidsetPoint(float value) Sets size value in point.toString()Returns a human-readable string representation of thisUnit.voidupdateResolution(float dpi)
-
Constructor Details
-
Unit
-
-
Method Details
-
getPixels
public float getPixels()Gets size value in pixels.
-
setPixels
public void setPixels(float value) Sets size value in pixels.
-
getInches
public float getInches()Gets size value in inches.
-
setInches
public void setInches(float value) Sets size value in inches.
-
getMillimeters
public float getMillimeters()Gets size value in millimeters.
-
setMillimeters
public void setMillimeters(float value) Sets size value in millimeters.
-
getPoint
public float getPoint()Gets size value in point.
-
setPoint
public void setPoint(float value) Sets size value in point.
-
getDocument
public float getDocument()Gets size value in document units.
-
setDocument
public void setDocument(float value) Sets size value in document units.
-
toString
Returns a human-readable string representation of this
Unit. -
equals
Determines whether this instance and a specified object, which must also be a
Unitobject, have the same value. -
hashCode
public int hashCode()Returns the hash code for this object.
-
getResolution
public float getResolution() -
updateResolution
public void updateResolution(float dpi)
-