GdPicture image identifier.
The data of the barcode to encode.
A member of the BarcodeDataMatrixEncodingMode enumeration. The encoding mode.
A member of the BarcodeDataMatrixVersion enumeration. The version of the DataMatrix barcode. Use BarcodeDataMatrixVersionAuto to let the engine decide the minimum version required to encode all data.
The number of modules composing the quiet zone. The quiet zone defines the margin around the barcode. A value superior or equal to 4 is highly suggested.
The size of each module, in pixels. A value superior or equal to 4 is recommended.
The left position, in pixels, of the DataMatrix barcode.
The top position, in pixels, of the DataMatrix barcode.
The QrCode angle.
Color of the symbols.
Color of the background.
Example





In This Topic
GdPicture14 Namespace / GdPictureImaging Class / BarcodeDataMatrixWrite Method / BarcodeDataMatrixWrite(Int32,String,BarcodeDataMatrixEncodingMode,BarcodeDataMatrixVersion,Int32,Int32,Int32,Int32,Single,GdPictureColor,GdPictureColor) Method

BarcodeDataMatrixWrite(Int32,String,BarcodeDataMatrixEncodingMode,BarcodeDataMatrixVersion,Int32,Int32,Int32,Int32,Single,GdPictureColor,GdPictureColor) Method

In This Topic
Draws a DataMatrix barcode on a GdPicture image.
Syntax
'Declaration
 
Public Overloads Function BarcodeDataMatrixWrite( _
   ByVal ImageID As Integer, _
   ByVal Data As String, _
   ByVal EncodingMode As BarcodeDataMatrixEncodingMode, _
   ByRef Version As BarcodeDataMatrixVersion, _
   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 BarcodeDataMatrixWrite( 
    ImageID: Integer;
    Data: String;
    EncodingMode: BarcodeDataMatrixEncodingMode;
   var  Version: BarcodeDataMatrixVersion;
    QuietZone: Integer;
    ModuleSize: Integer;
    DstLeft: Integer;
    DstTop: Integer;
    Angle: Single;
    FillColor: GdPictureColor;
    BackColor: GdPictureColor
): GdPictureStatus; 
public function BarcodeDataMatrixWrite( 
   ImageID : int,
   Data : String,
   EncodingMode : BarcodeDataMatrixEncodingMode,
   Version : BarcodeDataMatrixVersion,
   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.
EncodingMode
A member of the BarcodeDataMatrixEncodingMode enumeration. The encoding mode.
Version
A member of the BarcodeDataMatrixVersion enumeration. The version of the DataMatrix barcode. Use BarcodeDataMatrixVersionAuto to let the engine decide the minimum version required to encode all data.
QuietZone
The number of modules composing the quiet zone. The quiet zone defines the margin around the barcode. A value superior or equal to 4 is highly suggested.
ModuleSize
The size of each module, in pixels. A value superior or equal to 4 is recommended.
DstLeft
The left position, in pixels, of the DataMatrix barcode.
DstTop
The top position, in pixels, of the DataMatrix barcode.
Angle
The QrCode angle.
FillColor
Color of the symbols.
BackColor
Color of the background.

Return Value

A member of the GdPictureStatus enumeration.
Remarks

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

Example
Rendering a DataMatrix 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";
 
    BarcodeDataMatrixEncodingMode encodingMode = BarcodeDataMatrixEncodingMode.BarcodeDataMatrixEncodingModeUndefined;
    BarcodeDataMatrixVersion dmVersion = BarcodeDataMatrixVersion.BarcodeDataMatrixVersionAuto;
    int moduleSize = 8;
    Color fillColor = gdpictureImaging.ARGB(255, 0, 0, 0);
    Color backColor = gdpictureImaging.ARGB(0, 255, 255, 255);
 
    // Compute size (in pixels), required to render the DataMatrix barcode.
    gdpictureImaging.BarcodeDataMatrixGetSize(data, encodingMode, ref dmVersion, 4, moduleSize, out int width, out int height);
 
    int imageID = gdpictureImaging.CreateNewGdPictureImage(width, height, 32, Color.White);
    gdpictureImaging.BarcodeDataMatrixWrite(imageID, data, encodingMode, ref dmVersion, 4, moduleSize, 0, 0, 0, fillColor, backColor);
    gdpictureImaging.SaveAsPNG(imageID, "output.png");
 
    // Release used resources.
    gdpictureImaging.ReleaseGdPictureImage(imageID);
}
See Also