GdPicture.NET.14.API
GdPicture14 Namespace / GdPictureImaging Class / BarcodeMaxiCodeWrite Method / BarcodeMaxiCodeWrite(Int32,String,BarcodeMaxiCodeEncodingMode,Int32,Int32,Int32,Int32,Single,Int32,Int32) 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. A suitable color value can be obtained by using the ARGBI() method.
Color of the background. A suitable color value can be obtained by using the ARGBI() method.
Example





In This Topic
BarcodeMaxiCodeWrite(Int32,String,BarcodeMaxiCodeEncodingMode,Int32,Int32,Int32,Int32,Single,Int32,Int32) 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 Integer, _
   ByVal BackColor As Integer _
) As GdPictureStatus
public GdPictureStatus BarcodeMaxiCodeWrite( 
   int ImageID,
   string Data,
   BarcodeMaxiCodeEncodingMode Mode,
   int QuietZone,
   int ModuleSize,
   int DstLeft,
   int DstTop,
   float Angle,
   int FillColor,
   int BackColor
)
public function BarcodeMaxiCodeWrite( 
    ImageID: Integer;
    Data: String;
    Mode: BarcodeMaxiCodeEncodingMode;
    QuietZone: Integer;
    ModuleSize: Integer;
    DstLeft: Integer;
    DstTop: Integer;
    Angle: Single;
    FillColor: Integer;
    BackColor: Integer
): GdPictureStatus; 
public function BarcodeMaxiCodeWrite( 
   ImageID : int,
   Data : String,
   Mode : BarcodeMaxiCodeEncodingMode,
   QuietZone : int,
   ModuleSize : int,
   DstLeft : int,
   DstTop : int,
   Angle : float,
   FillColor : int,
   BackColor : int
) : GdPictureStatus;
public: GdPictureStatus BarcodeMaxiCodeWrite( 
   int ImageID,
   string* Data,
   BarcodeMaxiCodeEncodingMode Mode,
   int QuietZone,
   int ModuleSize,
   int DstLeft,
   int DstTop,
   float Angle,
   int FillColor,
   int BackColor
) 
public:
GdPictureStatus BarcodeMaxiCodeWrite( 
   int ImageID,
   String^ Data,
   BarcodeMaxiCodeEncodingMode Mode,
   int QuietZone,
   int ModuleSize,
   int DstLeft,
   int DstTop,
   float Angle,
   int FillColor,
   int BackColor
) 

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. A suitable color value can be obtained by using the ARGBI() method.
BackColor
Color of the background. A suitable color value can be obtained by using the ARGBI() method.

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 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