API Reference
Class
BarcodePngRenderer
Renders 1D barcodes to a PNG image (RGBA8).
Inheritance
- Object
- BarcodePngRenderer
Methods
public static Byte[] Render(Barcode1D barcode, BarcodePngRenderOptions opts) #Returns:
Byte[]Renders the barcode to a PNG byte array.
Parameters
- barcode CodeGlyphX.Barcode1D
- opts CodeGlyphX.Rendering.Png.BarcodePngRenderOptions
public static Byte[] RenderPixels(Barcode1D barcode, BarcodePngRenderOptions opts, out Int32 widthPx, out Int32 heightPx, out Int32 stride) #Returns:
Byte[]Renders the barcode to a raw RGBA pixel buffer (no PNG encoding).
Parameters
- barcode CodeGlyphX.Barcode1D
- opts CodeGlyphX.Rendering.Png.BarcodePngRenderOptions
- widthPx System.Int32@
- heightPx System.Int32@
- stride System.Int32@
RenderToFile 2 overloads
public static String RenderToFile(Barcode1D barcode, BarcodePngRenderOptions opts, String path) #Returns:
StringRenders the barcode to a PNG file.
Parameters
- barcode CodeGlyphX.Barcode1D
- Barcode to render.
- opts CodeGlyphX.Rendering.Png.BarcodePngRenderOptions
- Rendering options.
- path System.String
- Output file path.
Returns
The output file path.
public static String RenderToFile(Barcode1D barcode, BarcodePngRenderOptions opts, String directory, String fileName) #Returns:
StringRenders the barcode to a PNG file under the specified directory.
Parameters
- barcode CodeGlyphX.Barcode1D
- Barcode to render.
- opts CodeGlyphX.Rendering.Png.BarcodePngRenderOptions
- Rendering options.
- directory System.String
- Output directory.
- fileName System.String
- Output file name.
Returns
The output file path.
public static Void RenderToStream(Barcode1D barcode, BarcodePngRenderOptions opts, Stream stream) #Returns:
VoidRenders the barcode to a PNG stream.
Parameters
- barcode CodeGlyphX.Barcode1D
- Barcode to render.
- opts CodeGlyphX.Rendering.Png.BarcodePngRenderOptions
- Rendering options.
- stream System.IO.Stream
- Target stream.