GdPicture.NET.14.API
GdPicture14 Namespace / GdPictureImaging Class / BarcodeAztecGetSize Method
The data of the barcode to encode.
A member of the BarcodeAztecCodeVersion enumeration. The version of the Aztec barcode. Use BarcodeAztecCodeVersionAuto to let the engine decide the minimum version required to encode all data.
The percentage of error correction codewords. It could be a value from 5 to 95. A value of 23 is recommended.
The size, in pixels, of the quiet zone around the barcode. It could be 0, because Aztec barcodes does no require a mandatory quiet zone.
The size of each module, in pixels.
Output parameter. The width, in pixels, required to render the whole Aztec barcode.
Output parameter. The height, in pixels, required to render the whole Aztec barcode.
Example





In This Topic
BarcodeAztecGetSize Method (GdPictureImaging)
In This Topic
Returns the size, in pixels, required to render an Aztec barcode on a Bitmap.
Syntax
'Declaration
 
Public Function BarcodeAztecGetSize( _
   ByVal Data As String, _
   ByRef Version As BarcodeAztecCodeVersion, _
   ByVal EccPercent As Integer, _
   ByVal QuietZone As Integer, _
   ByVal ModuleSize As Integer, _
   ByRef Width As Integer, _
   ByRef Height As Integer _
) As GdPictureStatus
public GdPictureStatus BarcodeAztecGetSize( 
   string Data,
   ref BarcodeAztecCodeVersion Version,
   int EccPercent,
   int QuietZone,
   int ModuleSize,
   out int Width,
   out int Height
)
public function BarcodeAztecGetSize( 
    Data: String;
   var  Version: BarcodeAztecCodeVersion;
    EccPercent: Integer;
    QuietZone: Integer;
    ModuleSize: Integer;
   Out  Width: Integer;
   Out  Height: Integer
): GdPictureStatus; 
public function BarcodeAztecGetSize( 
   Data : String,
   Version : BarcodeAztecCodeVersion,
   EccPercent : int,
   QuietZone : int,
   ModuleSize : int,
   Width : int,
   Height : int
) : GdPictureStatus;
public: GdPictureStatus BarcodeAztecGetSize( 
   string* Data,
   ref BarcodeAztecCodeVersion Version,
   int EccPercent,
   int QuietZone,
   int ModuleSize,
   [PARAMFLAG::Out] int Width,
   [PARAMFLAG::Out] int Height
) 
public:
GdPictureStatus BarcodeAztecGetSize( 
   String^ Data,
   BarcodeAztecCodeVersion% Version,
   int EccPercent,
   int QuietZone,
   int ModuleSize,
   [Out] int Width,
   [Out] int Height
) 

Parameters

Data
The data of the barcode to encode.
Version
A member of the BarcodeAztecCodeVersion enumeration. The version of the Aztec barcode. Use BarcodeAztecCodeVersionAuto to let the engine decide the minimum version required to encode all data.
EccPercent
The percentage of error correction codewords. It could be a value from 5 to 95. A value of 23 is recommended.
QuietZone
The size, in pixels, of the quiet zone around the barcode. It could be 0, because Aztec barcodes does no require a mandatory quiet zone.
ModuleSize
The size of each module, in pixels.
Width
Output parameter. The width, in pixels, required to render the whole Aztec barcode.
Height
Output parameter. The height, in pixels, required to render the whole Aztec barcode.

Return Value

A member of the GdPictureStatus enumeration.
Remarks
Use the GetStat() method to determine if this method has been successful.
Example
Rendering an Aztec barcode into a new image and saving the result into a png file.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
    // String with numbers, which have to be encoded into a barcode.
    string data = "123456";
 
    BarcodeAztecCodeVersion version = BarcodeAztecCodeVersion.BarcodeAztecCodeVersionAuto;
    int moduleSize = 8;
    Color fillColor = gdpictureImaging.ARGB(255, 0, 0, 0);
    Color backColor = gdpictureImaging.ARGB(0, 255, 255, 255);
    int dstLeft = 10;
    int dstTop = 10;
 
    // Compute size (in pixels), required to render an Aztec barcode.
    gdpictureImaging.BarcodeAztecGetSize(data, ref version, 23, 0, moduleSize, out int width, out int height);
 
    int imageID = gdpictureImaging.CreateNewGdPictureImage(20 + width, 20 + height, 32, Color.White);
    gdpictureImaging.BarcodeAztecWrite(imageID, data, ref version, 23, 0, moduleSize, dstLeft, dstTop, 0, fillColor, backColor);
    gdpictureImaging.SaveAsPNG(imageID, "output.png");
 
    // Release used resources.
    gdpictureImaging.ReleaseGdPictureImage(imageID);
}
See Also