GdPicture.NET.14.API
GdPicture14 Namespace / GdPictureImaging Class / Barcode1DWrite Method / Barcode1DWrite(Int32,Barcode1DWriterType,String,Int32,Int32,Int32,Int32,GdPictureColor) Method
GdPicture image identifier.
A member of the Barcode1DWriterType enumeration.
The data of the barcode to encode.
Left pixel destination of to top-left corner of bounding box the barcode.
Top pixel destination of to top-left corner of bounding box of the barcode.
Width of the bounding box of the barcode.
Height of the bounding box of the barcode.
Color of the barcode. A suitable color value can be obtained by using the ARGB() method.
Example





In This Topic
Barcode1DWrite(Int32,Barcode1DWriterType,String,Int32,Int32,Int32,Int32,GdPictureColor) Method
In This Topic
Draws a 1D barcode on a GdPicture image.
Syntax
'Declaration
 
Public Overloads Function Barcode1DWrite( _
   ByVal ImageID As Integer, _
   ByVal BarcodeType As Barcode1DWriterType, _
   ByVal Data As String, _
   ByVal DstLeft As Integer, _
   ByVal DstTop As Integer, _
   ByVal DstWidth As Integer, _
   ByVal DstHeight As Integer, _
   ByVal FillColor As GdPictureColor _
) As GdPictureStatus
public function Barcode1DWrite( 
    ImageID: Integer;
    BarcodeType: Barcode1DWriterType;
    Data: String;
    DstLeft: Integer;
    DstTop: Integer;
    DstWidth: Integer;
    DstHeight: Integer;
    FillColor: GdPictureColor
): GdPictureStatus; 
public function Barcode1DWrite( 
   ImageID : int,
   BarcodeType : Barcode1DWriterType,
   Data : String,
   DstLeft : int,
   DstTop : int,
   DstWidth : int,
   DstHeight : int,
   FillColor : GdPictureColor
) : GdPictureStatus;
public: GdPictureStatus Barcode1DWrite( 
   int ImageID,
   Barcode1DWriterType BarcodeType,
   string* Data,
   int DstLeft,
   int DstTop,
   int DstWidth,
   int DstHeight,
   GdPictureColor FillColor
) 
public:
GdPictureStatus Barcode1DWrite( 
   int ImageID,
   Barcode1DWriterType BarcodeType,
   String^ Data,
   int DstLeft,
   int DstTop,
   int DstWidth,
   int DstHeight,
   GdPictureColor FillColor
) 

Parameters

ImageID
GdPicture image identifier.
BarcodeType
A member of the Barcode1DWriterType enumeration.
Data
The data of the barcode to encode.
DstLeft
Left pixel destination of to top-left corner of bounding box the barcode.
DstTop
Top pixel destination of to top-left corner of bounding box of the barcode.
DstWidth
Width of the bounding box of the barcode.
DstHeight
Height of the bounding box of the barcode.
FillColor
Color of the barcode. A suitable color value can be obtained by using the ARGB() method.

Return Value

A member of the GdPictureStatus enumeration.
Example
Rendering a 1D 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";
 
    int dstLeft = 10;
    int dstTop = 10;
    int dstWidth = 300; //Barcode width
    int dstHeight = 80; //Barcode height
 
    // Select the 1D barcode type.
    Barcode1DWriterType barcodeType = Barcode1DWriterType.Barcode1DWriterStandard2of5;
 
    int imageID = gdpictureImaging.CreateNewGdPictureImage(20 + dstWidth, 20 + dstHeight, 32, Color.White);
    gdpictureImaging.Barcode1DWrite(imageID, barcodeType, data, dstLeft, dstTop, dstWidth, dstHeight, gdpictureImaging.ARGB(0, 0, 0));
    gdpictureImaging.SaveAsPNG(imageID, "output.png");
 
    // Release used resources.
    gdpictureImaging.ReleaseGdPictureImage(imageID);
}
See Also