GdPicture.NET.14.API
GdPicture14 Namespace / GdPictureImaging Class / BarcodeMaxiCodeWrite Method / BarcodeMaxiCodeWrite(Int32,String,BarcodeMaxiCodeEncodingMode,Int32,Int32,Int32,Int32,Single,GdPictureColor,GdPictureColor) Method
GdPicture image identifier.
The data of the barcode to encode.
A member of the BarcodeMaxiCodeEncodingMode enumeration. The mode used to encode the MaxiCode.
The number of modules considered as quiet zone around the barcode.
The size of each module, in pixels.
The left position, in pixels, of the MaxiCode.
The top position, in pixels, of the MaxiCode.
The MaxiCode angle.
Color of the symbols.
Color of the background.
Example





In This Topic
BarcodeMaxiCodeWrite(Int32,String,BarcodeMaxiCodeEncodingMode,Int32,Int32,Int32,Int32,Single,GdPictureColor,GdPictureColor) Method
In This Topic
Draws a MaxiCode on a GdPicture image.
Syntax
'Declaration
 
Public Overloads Function BarcodeMaxiCodeWrite( _
   ByVal ImageID As Integer, _
   ByVal Data As String, _
   ByVal Mode As BarcodeMaxiCodeEncodingMode, _
   ByVal QuietZone As Integer, _
   ByVal ModuleSize As Integer, _
   ByVal DstLeft As Integer, _
   ByVal DstTop As Integer, _
   ByVal Angle As Single, _
   ByVal FillColor As GdPictureColor, _
   ByVal BackColor As GdPictureColor _
) As GdPictureStatus
public function BarcodeMaxiCodeWrite( 
    ImageID: Integer;
    Data: String;
    Mode: BarcodeMaxiCodeEncodingMode;
    QuietZone: Integer;
    ModuleSize: Integer;
    DstLeft: Integer;
    DstTop: Integer;
    Angle: Single;
    FillColor: GdPictureColor;
    BackColor: GdPictureColor
): GdPictureStatus; 
public function BarcodeMaxiCodeWrite( 
   ImageID : int,
   Data : String,
   Mode : BarcodeMaxiCodeEncodingMode,
   QuietZone : int,
   ModuleSize : int,
   DstLeft : int,
   DstTop : int,
   Angle : float,
   FillColor : GdPictureColor,
   BackColor : GdPictureColor
) : GdPictureStatus;

Parameters

ImageID
GdPicture image identifier.
Data
The data of the barcode to encode.
Mode
A member of the BarcodeMaxiCodeEncodingMode enumeration. The mode used to encode the MaxiCode.
QuietZone
The number of modules considered as quiet zone around the barcode.
ModuleSize
The size of each module, in pixels.
DstLeft
The left position, in pixels, of the MaxiCode.
DstTop
The top position, in pixels, of the MaxiCode.
Angle
The MaxiCode angle.
FillColor
Color of the symbols.
BackColor
Color of the background.

Return Value

A member of the GdPictureStatus enumeration.
Remarks
Use the GetStat() method to determine if this method has been successful.

This method requires the Barcode Reading & Writing component to run.

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 gs = ((char)0x1D).ToString();
    string data = "123456" + gs + "040" + gs + "001" + gs + "Additional Data";
    Color fillColor = gdpictureImaging.ARGB(255, 0, 0, 0);
    Color backColor = gdpictureImaging.ARGB(0, 255, 255, 255);
    int dstLeft = 10;
    int dstTop = 10;
    int moduleSize = 15;
            
    // Compute size (in pixels), required to render a MaxiCode.
    gdpictureImaging.BarcodeMaxiCodeGetSize(1, moduleSize, out int width, out int height);
            
    int imageID = gdpictureImaging.CreateNewGdPictureImage(dstLeft + width, dstTop + height, 32, Color.White);
    gdpictureImaging.BarcodeMaxiCodeWrite(imageID, data, BarcodeMaxiCodeEncodingMode.Mode2, 1, moduleSize, dstLeft, dstTop, 0, fillColor, backColor);
    gdpictureImaging.SaveAsPNG(imageID, "output.png");
            
    // Release used resources.
    gdpictureImaging.ReleaseGdPictureImage(imageID);
}
See Also