Project

ChartForgeX

Render deterministic charts, dashboards, topology, hierarchy, and report visuals directly from .NET.

Stars 47
Forks 2
NuGet downloads 75,067
Release ChartForgeX-v2.0.0
Language: HTML Updated: 2026-10-12

API Reference

Struct

RgbaImage

Namespace ChartForgeX.Raster
Assembly ChartForgeX
Base ValueType
Modifiers sealed

Represents a dependency-free 32-bit RGBA raster image.

Inheritance

  • ValueType
  • RgbaImage

Remarks

This value borrows the supplied mutable pixel array without copying it. Keep the array alive and avoid changing it while a renderer or encoder uses the image. Composition and typed visual-canvas image entrypoints document when they create independent snapshots.

Usage

Explore 75 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Returned or exposed by 45

Accepted by parameters 30

Constructors

public RgbaImage(Int32 width, Int32 height, Byte[] pixels) #

Initializes an RGBA raster image.

Parameters

width System.Int32 requiredposition: 0
The image width in pixels.
height System.Int32 requiredposition: 1
The image height in pixels.
pixels System.Byte[] requiredposition: 2
Borrowed mutable RGBA pixels, row-major from top-left. The constructor does not copy the array.

Fields

public readonly Int32 Width #

Gets the image width in pixels.

public readonly Int32 Height #

Gets the image height in pixels.

public readonly Byte[] Pixels #

Gets the image pixels as RGBA bytes, row-major from top-left.

Extension Methods

public static Void SaveGif(RgbaImage image, String path) #
Returns: Void

Saves one RGBA image as a single-frame GIF.

Parameters

image ChartForgeX.Raster.RgbaImage requiredposition: 0
path System.String requiredposition: 1
SaveRasterImage 2 overloads
public static Void SaveRasterImage(RgbaImage image, String path, RasterImageFormat format, RasterImageOptions? options = null) #
Returns: Void

Saves RGBA pixels to a dependency-free raster file.

Parameters

image ChartForgeX.Raster.RgbaImage requiredposition: 0
The image to encode.
path System.String requiredposition: 1
The output file path.
format ChartForgeX.Core.RasterImageFormat requiredposition: 2
The raster image format.
options ChartForgeX.Core.RasterImageOptions? = null optionalposition: 3
Optional raster export options.
public static Void SaveRasterImage(RgbaImage image, String path, RasterImageOptions? options = null) #
Returns: Void

Saves RGBA pixels to a raster file using the output path extension to choose the format.

Parameters

image ChartForgeX.Raster.RgbaImage requiredposition: 0
The image to encode.
path System.String requiredposition: 1
The output file path.
options ChartForgeX.Core.RasterImageOptions? = null optionalposition: 2
Optional raster export options.
public static Byte[] ToGif(RgbaImage image) #
Returns: Byte[]

Encodes one RGBA image as a single-frame GIF.

Parameters

image ChartForgeX.Raster.RgbaImage requiredposition: 0
public static Byte[] ToJpeg(RgbaImage image, RasterImageOptions? options = null) #
Returns: Byte[]

Encodes RGBA pixels to JPEG bytes after flattening transparent pixels against the configured background.

Parameters

image ChartForgeX.Raster.RgbaImage requiredposition: 0
The image to encode.
options ChartForgeX.Core.RasterImageOptions? = null optionalposition: 1
Optional raster export options.

Returns

A JPEG image.

ToPng 2 overloads
public static Byte[] ToPng(RgbaImage image) #
Returns: Byte[]

Encodes RGBA pixels to PNG bytes.

Parameters

image ChartForgeX.Raster.RgbaImage requiredposition: 0
The image to encode.

Returns

A PNG image.

public static Byte[] ToPng(RgbaImage image, RasterImageOptions? options) #
Returns: Byte[]

Encodes an RGBA image as PNG bytes using dependency-free raster options.

Parameters

image ChartForgeX.Raster.RgbaImage requiredposition: 0
options ChartForgeX.Core.RasterImageOptions? requiredposition: 1
public static Byte[] ToRasterImage(RgbaImage image, RasterImageFormat format, RasterImageOptions? options = null) #
Returns: Byte[]

Encodes RGBA pixels to a dependency-free raster format.

Parameters

image ChartForgeX.Raster.RgbaImage requiredposition: 0
The image to encode.
format ChartForgeX.Core.RasterImageFormat requiredposition: 1
The raster image format.
options ChartForgeX.Core.RasterImageOptions? = null optionalposition: 2
Optional raster export options.

Returns

Encoded raster image bytes.

public static VisualCanvas ToVisualCanvas(RgbaImage image, VisualCanvasImageFit fit = Stretch) #
Returns: VisualCanvas

Creates a visual canvas from decoded RGBA pixels with the image as the first layer.

Parameters

image ChartForgeX.Raster.RgbaImage requiredposition: 0
fit ChartForgeX.Composition.VisualCanvasImageFit = Stretch optionalposition: 1
public static Void WriteGif(RgbaImage image, Stream stream) #
Returns: Void

Writes one RGBA image as a single-frame GIF.

Parameters

image ChartForgeX.Raster.RgbaImage requiredposition: 0
stream System.IO.Stream requiredposition: 1
public static Void WriteRasterImage(RgbaImage image, Stream stream, RasterImageFormat format, RasterImageOptions? options = null) #
Returns: Void

Writes RGBA pixels to a dependency-free raster stream.

Parameters

image ChartForgeX.Raster.RgbaImage requiredposition: 0
The image to encode.
stream System.IO.Stream requiredposition: 1
The destination stream.
format ChartForgeX.Core.RasterImageFormat requiredposition: 2
The raster image format.
options ChartForgeX.Core.RasterImageOptions? = null optionalposition: 3
Optional raster export options.