GdPicture.NET.14
GdPicture14 Namespace / GdPictureImaging Class / BarcodeMaxiCodeGetSize Method
The number of modules considered as quiet zone around the barcode.
The distance, in pixels, between two modules on the same horizontal line.
Output parameter. The width, in pixels, required to render the whole MaxiCode.
Output parameter. The height, in pixels, required to render the whole MaxiCode.
Example





In This Topic
BarcodeMaxiCodeGetSize Method (GdPictureImaging)
In This Topic
Returns the size, in pixels, required to render a MaxiCode on a Bitmap.
Syntax
'Declaration
 
Public Function BarcodeMaxiCodeGetSize( _
   ByVal QuietZone As Integer, _
   ByVal ModuleSize As Integer, _
   ByRef Width As Integer, _
   ByRef Height As Integer _
) As GdPictureStatus
public GdPictureStatus BarcodeMaxiCodeGetSize( 
   int QuietZone,
   int ModuleSize,
   out int Width,
   out int Height
)
public function BarcodeMaxiCodeGetSize( 
    QuietZone: Integer;
    ModuleSize: Integer;
   Out  Width: Integer;
   Out  Height: Integer
): GdPictureStatus; 
public function BarcodeMaxiCodeGetSize( 
   QuietZone : int,
   ModuleSize : int,
   Width : int,
   Height : int
) : GdPictureStatus;
public: GdPictureStatus BarcodeMaxiCodeGetSize( 
   int QuietZone,
   int ModuleSize,
   [PARAMFLAG::Out] int Width,
   [PARAMFLAG::Out] int Height
) 
public:
GdPictureStatus BarcodeMaxiCodeGetSize( 
   int QuietZone,
   int ModuleSize,
   [Out] int Width,
   [Out] int Height
) 

Parameters

QuietZone
The number of modules considered as quiet zone around the barcode.
ModuleSize
The distance, in pixels, between two modules on the same horizontal line.
Width
Output parameter. The width, in pixels, required to render the whole MaxiCode.
Height
Output parameter. The height, in pixels, required to render the whole MaxiCode.

Return Value

A member of the GdPictureStatus enumeration.
Remarks
Use the GetStat() method to determine if this method has been successful.
Example
Rendering a MaxiCode 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";
 
    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 a MaxiCode.
    gdpictureImaging.BarcodeMaxiCodeGetSize(1, moduleSize, out int width, out int height);
 
    int imageID = gdpictureImaging.CreateNewGdPictureImage(width, height, 32, Color.White);
    gdpictureImaging.BarcodeMaxiCodeWrite(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