Class BaseGenerationParameters

Class BaseGenerationParameters

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

Barcode image generation parameters.

[XmlSerialization(Name = "Aspose.BarCode.Generator.Properties")]
public class BaseGenerationParameters

Inheritance

objectBaseGenerationParameters

Inherited Members

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

Properties

AutoSizeMode

Specifies the different types of automatic sizing modes. Default value: AutoSizeMode.None.

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

Property Value

AutoSizeMode

BackColor

Background color of the barcode image. Default value: Color.White. See System.Drawing.Color.

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

Property Value

Color

Barcode

Gets the Aspose.BarCode.Generation.BarcodeParameters that contains all barcode properties.

[XmlSerialization(Type = XmlSerializationType.Element)]
public BarcodeParameters Barcode { get; }

Property Value

BarcodeParameters

Border

Gets the Aspose.BarCode.Generation.BorderParameters that contains all configuration properties for barcode border.

[XmlSerialization(Type = XmlSerializationType.Element)]
public BorderParameters Border { get; }

Property Value

BorderParameters

CaptionAbove

Caption Above the BarCode image. See Aspose.BarCode.Generation.CaptionParameters.

[XmlSerialization(Type = XmlSerializationType.Element, Name = "CaptionAbove")]
public CaptionParameters CaptionAbove { get; }

Property Value

CaptionParameters

CaptionBelow

Caption Below the BarCode image. See Aspose.BarCode.Generation.CaptionParameters.

[XmlSerialization(Type = XmlSerializationType.Element, Name = "CaptionBelow")]
public CaptionParameters CaptionBelow { get; }

Property Value

CaptionParameters

Image

Image parameters. See Aspose.BarCode.Generation.ImageParameters.

[XmlSerialization(Type = XmlSerializationType.Element, Name = "Image")]
public ImageParameters Image { get; }

Property Value

ImageParameters

ImageHeight

BarCode image height when Aspose.BarCode.Generation.BaseGenerationParameters.AutoSizeMode property is set to AutoSizeMode.Nearest or AutoSizeMode.Interpolation.

[XmlSerialization(Type = XmlSerializationType.Element, Name = "ImageHeight")]
public Unit ImageHeight { get; set; }

Property Value

Unit

ImageWidth

BarCode image width when Aspose.BarCode.Generation.BaseGenerationParameters.AutoSizeMode property is set to AutoSizeMode.Nearest or AutoSizeMode.Interpolation.

[XmlSerialization(Type = XmlSerializationType.Element, Name = "ImageWidth")]
public Unit ImageWidth { get; set; }

Property Value

Unit

Resolution

Gets or sets the resolution of the BarCode image. One value for both dimensions. Default value: 96 dpi.

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

Property Value

float

Exceptions

ArgumentException

The Resolution parameter value is less than or equal to 0.

RotationAngle

BarCode image rotation angle, measured in degree, e.g. RotationAngle = 0 or RotationAngle = 360 means no rotation. If RotationAngle NOT equal to 90, 180, 270 or 0, it may increase the difficulty for the scanner to read the image. Default value: 0.

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

Property Value

float

Examples

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

using (var generator = new BarcodeGenerator(EncodeTypes.DataMatrix))
  {
      generator.Parameters.RotationAngle = 7f;
      generator.Save("test.png");
  }

UseAntiAlias

Gets or sets a value indicating whether is used anti-aliasing mode to render image

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

Property Value

bool

 English