GdPicture.NET Reference Guide
BarcodePDF417GetSize Method (GdPictureImaging)
Example 





GdPicture14 Namespace > GdPictureImaging Class : BarcodePDF417GetSize Method
The data of the barcode to encode.
A member of the BarcodePDF417EncodingMode enumeration. The encoding mode.
A member of the BarcodePDF417ErrorCorrectionLevel enumeration. The error correction level.
Specifies the number of rows constituting the barcode. Use 0 for automatic computation (recommended) or a value in the range [3 - 90].
Specifies the number of columns constituting the barcode. Use 0 for automatic computation (recommended) or a value in the range [3 - 30].
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 width of each module, in pixel. A value superior or equal to 4 is recommended.
The height of each row, in pixel. A value superior or equal to 10 is recommended.
Output parameter. The width, in pixel, required to render the PDF417 barcode.
Output parameter. The height, in pixel, required to render the PDF417 barcode.
Returns the size, in pixel, required to render a PDF417 barcode on a Bitmap.
Syntax
'Declaration
 
Public Function BarcodePDF417GetSize( _
   ByVal Data As String, _
   ByVal EncodingMode As BarcodePDF417EncodingMode, _
   ByRef ErrorCorrectionLevel As BarcodePDF417ErrorCorrectionLevel, _
   ByRef Rows As Integer, _
   ByRef Cols As Integer, _
   ByVal QuietZone As Integer, _
   ByVal ModuleWidth As Integer, _
   ByVal RowHeight As Integer, _
   ByRef Width As Integer, _
   ByRef Height As Integer _
) As GdPictureStatus

Parameters

Data
The data of the barcode to encode.
EncodingMode
A member of the BarcodePDF417EncodingMode enumeration. The encoding mode.
ErrorCorrectionLevel
A member of the BarcodePDF417ErrorCorrectionLevel enumeration. The error correction level.
Rows
Specifies the number of rows constituting the barcode. Use 0 for automatic computation (recommended) or a value in the range [3 - 90].
Cols
Specifies the number of columns constituting the barcode. Use 0 for automatic computation (recommended) or a value in the range [3 - 30].
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.
ModuleWidth
The width of each module, in pixel. A value superior or equal to 4 is recommended.
RowHeight
The height of each row, in pixel. A value superior or equal to 10 is recommended.
Width
Output parameter. The width, in pixel, required to render the PDF417 barcode.
Height
Output parameter. The height, in pixel, required to render the PDF417 barcode.

Return Value

A member of the GdPictureStatus enumeration.
Example
Drawing a PDF417 barcode into a new GdPicture bitmap and save it as PNG image.
Const data As String = "abcdefghijklmnopqrstuvwxyz0123456789"
Const moduleWidth As Integer = 4
Const rowHeight As Integer = 10
Const quietZoneSize As Integer = 4
Const encodingMode As BarcodePDF417EncodingMode = BarcodePDF417EncodingMode.BarcodePDF417EncodingModeUndefined
Dim ecc As BarcodePDF417ErrorCorrectionLevel = BarcodePDF417ErrorCorrectionLevel.BarcodePDF417ErrorCorrectionLevelAuto
Dim oGdPictureImaging As New GdPictureImaging
Dim Rows As Integer = 0
Dim Cols As Integer = 0
Dim width, height As Integer
If oGdPictureImaging.BarcodePDF417GetSize(data, encodingMode, ecc, Rows, Cols, quietZoneSize, moduleWidth, rowHeight, width, height) = GdPictureStatus.OK Then
   Dim ImageID As Integer = oGdPictureImaging.CreateNewGdPictureImage(width, height, Imaging.PixelFormat.Format24bppRgb, Color.Transparent)
   oGdPictureImaging.BarcodePDF417Write(ImageID, data, encodingMode, ecc, Rows, Cols, quietZoneSize, moduleWidth, rowHeight, 0, 0, 0, Color.Red, Color.White)
   oGdPictureImaging.SaveAsPNG(ImageID, "pdf417.png")
   oGdPictureImaging.ReleaseGdPictureImage(ImageID)
End If
See Also

Reference

GdPictureImaging Class
GdPictureImaging Members
BarcodePDF417Write(Int32,String,BarcodePDF417EncodingMode,BarcodePDF417ErrorCorrectionLevel,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Single,Color,Color) Method