ImageComposition
ChartForgeX.Composition
Dependency-free RGBA image composition surface for wallpapers, previews, reports, and reusable renderer hosts.
Inheritance
- object
- ImageComposition
Usage
Explore 43 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 41
- Method ImageComposition.Bloom
- Method ImageComposition.Blur
- Method ImageComposition.BlurRegion
- Method ImageComposition.Clear
- Method ImageComposition.Create
- Method ImageComposition.CreatePanel
- Method ImageComposition.CreateTransparent
- Method ImageComposition.DrawArc
- Method ImageComposition.DrawCallout
- Method ImageComposition.DrawChart
- Method ImageComposition.DrawChartGrid
- Method ImageComposition.DrawDashedLine
- Method ImageComposition.DrawImage
- Method ImageComposition.DrawImageBytes
- Method ImageComposition.DrawImageFile
- Method ImageComposition.DrawLayer
- Method ImageComposition.DrawLine
- Method ImageComposition.DrawProgressRing
- Method ImageComposition.DrawShadow
- Method ImageComposition.DrawText
- Method ImageComposition.DrawTextLayout
- Method ImageComposition.DrawTopology
- Method ImageComposition.DrawVisualBlock
- Method ImageComposition.DrawVisualCanvas
- Method ImageComposition.DrawVisualGrid
- Method ImageComposition.FillCircle
- Method ImageComposition.FillDotPattern
- Method ImageComposition.FillEllipse
- Method ImageComposition.FillGridPattern
- Method ImageComposition.FillRectangle
- Method ImageComposition.FillRectangleLinearGradient
- Method ImageComposition.FillRectangleRadialGradient
- Method ImageComposition.FillRoundedRectangle
- Method ImageComposition.FromBytes
- Method ImageComposition.FromFile
- Method ImageComposition.FromImage
- Method ImageComposition.Outline
- Method ImageComposition.StrokeCircle
- Method ImageComposition.StrokeEllipse
- Method ImageComposition.StrokeRectangle
- Method ImageComposition.StrokeRoundedRectangle
Accepted by parameters 2
- Method ImageComposition.TryFromBytes
- Method ImageComposition.TryFromFile
Methods
public ImageComposition Bloom(VisualBloom effect, CancellationToken cancellationToken = default) #Blurs an explicit luminance bright pass and Screens it over the current fixed-frame pixels.
Parameters
- effect ChartForgeX.Effects.VisualBloom
- Required threshold and strength; sigma is resolved at this composition's device density once.
- cancellationToken System.Threading.CancellationToken = default
- Cancellation leaves the destination unchanged until one final commit.
public ImageComposition Blur(double sigmaX, double? sigmaY = null, CancellationToken cancellationToken = default) #Blurs all current pixels, including text, using the shared bounded three-box Gaussian approximation.
Parameters
- sigmaX double
- Horizontal standard-deviation target in stored device pixels, from zero through 128.
- sigmaY double? = null
- Vertical target in stored device pixels; null uses the horizontal target.
- cancellationToken System.Threading.CancellationToken = default
- Cancels before the final pixel replacement.
public ImageComposition BlurRegion(VisualMask coverage, VisualLayerBlur blur, CancellationToken cancellationToken = default) #Replaces the explicit destination by its blur in proportion to detached mask coverage.
Parameters
- coverage ChartForgeX.Effects.VisualMask
- Same-density, device-aligned coverage. Its dither option affects final mixed alpha only.
- blur ChartForgeX.Effects.VisualLayerBlur
- Logical Gaussian targets. Its dither option affects the filtered RGBA result before mixing.
- cancellationToken System.Threading.CancellationToken = default
- Cancellation leaves the original destination unchanged before commit.
public ImageComposition Clear(ChartColor color) #Fills the whole composition with a color.
Parameters
- color ChartForgeX.Primitives.ChartColor
Returns
ImageCompositionpublic static ImageComposition Create(int width, int height, ChartColor background) #Creates a new composition with the requested background.
Parameters
- width int
- height int
- background ChartForgeX.Primitives.ChartColor
Returns
ImageCompositionpublic static ImageComposition CreatePanel(int width, int height, ChartColor background, ChartColor? border = null, double cornerRadius = 0, double borderThickness = 1) #Creates a panel with an optional rounded fill and an outline painted inside its pixel bounds.
Parameters
- width int
- height int
- background ChartForgeX.Primitives.ChartColor
- border ChartForgeX.Primitives.ChartColor? = null
- cornerRadius double = 0
- borderThickness double = 1
Returns
ImageCompositionpublic static ImageComposition CreateTransparent(int width, int height) #Creates a transparent composition.
Parameters
- width int
- height int
Returns
ImageCompositionpublic ImageComposition DrawArc(double centerX, double centerY, double radius, double startAngle, double sweepAngle, ChartColor color, double thickness = 1, ImageLineCap lineCap = Round) #Draws an antialiased circular arc. Angles are in degrees, measured clockwise on screen from the positive x axis (three o'clock), so -90 starts at twelve o'clock. A positive sweep runs clockwise; a sweep of 360 degrees or more draws the whole ring.
Parameters
- centerX double
- centerY double
- radius double
- startAngle double
- sweepAngle double
- color ChartForgeX.Primitives.ChartColor
- thickness double = 1
- lineCap ChartForgeX.Composition.ImageLineCap = Round
Returns
ImageCompositionpublic ImageComposition DrawCallout(double anchorX, double anchorY, double boxX, double boxY, double boxWidth, double boxHeight, string text, double fontSize, ChartColor lineColor, ChartColor fillColor, ChartColor textColor, double radius = 4, double thickness = 1, double padding = 4) #Draws a leader line and rounded text box callout for reusable image annotations.
Parameters
- anchorX double
- anchorY double
- boxX double
- boxY double
- boxWidth double
- boxHeight double
- text string
- fontSize double
- lineColor ChartForgeX.Primitives.ChartColor
- fillColor ChartForgeX.Primitives.ChartColor
- textColor ChartForgeX.Primitives.ChartColor
- radius double = 4
- thickness double = 1
- padding double = 4
Returns
ImageCompositionpublic ImageComposition DrawChart(Chart chart, double x, double y, double width, double height, VisualCanvasImageFit fit = Stretch, double opacity = 1) #Draws a chart layer.
Parameters
- chart ChartForgeX.Core.Chart
- x double
- y double
- width double
- height double
- fit ChartForgeX.Composition.VisualCanvasImageFit = Stretch
- opacity double = 1
Returns
ImageCompositionpublic ImageComposition DrawChart(Chart chart, VisualCanvasPlacement placement, double width, double height, VisualCanvasImageFit fit = Stretch, double opacity = 1) #Draws a chart layer using anchor-based placement.
Parameters
- chart ChartForgeX.Core.Chart
- placement ChartForgeX.Composition.VisualCanvasPlacement
- width double
- height double
- fit ChartForgeX.Composition.VisualCanvasImageFit = Stretch
- opacity double = 1
Returns
ImageCompositionpublic ImageComposition DrawChartGrid(ChartGrid grid, double x, double y, double width, double height, VisualCanvasImageFit fit = Stretch, double opacity = 1) #Draws a chart grid layer.
Parameters
- grid ChartForgeX.Core.ChartGrid
- x double
- y double
- width double
- height double
- fit ChartForgeX.Composition.VisualCanvasImageFit = Stretch
- opacity double = 1
Returns
ImageCompositionpublic ImageComposition DrawChartGrid(ChartGrid grid, VisualCanvasPlacement placement, double width, double height, VisualCanvasImageFit fit = Stretch, double opacity = 1) #Draws a chart grid layer using anchor-based placement.
Parameters
- grid ChartForgeX.Core.ChartGrid
- placement ChartForgeX.Composition.VisualCanvasPlacement
- width double
- height double
- fit ChartForgeX.Composition.VisualCanvasImageFit = Stretch
- opacity double = 1
Returns
ImageCompositionpublic ImageComposition DrawDashedLine(double x0, double y0, double x1, double y1, ChartColor color, double thickness = 1, double dash = 6, double gap = 5) #Draws a dashed line segment.
Parameters
- x0 double
- y0 double
- x1 double
- y1 double
- color ChartForgeX.Primitives.ChartColor
- thickness double = 1
- dash double = 6
- gap double = 5
Returns
ImageCompositionpublic ImageComposition DrawImage(RgbaImage image, double x, double y, double width, double height, VisualCanvasImageFit fit = Stretch, double opacity = 1) #Draws an image into an explicit destination rectangle.
Parameters
- image ChartForgeX.Raster.RgbaImage
- x double
- y double
- width double
- height double
- fit ChartForgeX.Composition.VisualCanvasImageFit = Stretch
- opacity double = 1
Returns
ImageCompositionpublic ImageComposition DrawImage(RgbaImage image, VisualCanvasPlacement placement, double width, double height, VisualCanvasImageFit fit = Stretch, double opacity = 1) #Draws an image using anchor-based placement.
Parameters
- image ChartForgeX.Raster.RgbaImage
- placement ChartForgeX.Composition.VisualCanvasPlacement
- width double
- height double
- fit ChartForgeX.Composition.VisualCanvasImageFit = Stretch
- opacity double = 1
Returns
ImageCompositionpublic ImageComposition DrawImageBytes(byte[] data, double x, double y, double width, double height, VisualCanvasImageFit fit = Stretch, double opacity = 1, RasterDecodeOptions? options = null) #Decodes image bytes within the requested limits and draws them into an explicit destination rectangle.
Parameters
- data byte[]
- x double
- y double
- width double
- height double
- fit ChartForgeX.Composition.VisualCanvasImageFit = Stretch
- opacity double = 1
- options ChartForgeX.Raster.RasterDecodeOptions? = null
Returns
ImageCompositionpublic ImageComposition DrawImageBytes(byte[] data, VisualCanvasPlacement placement, double width, double height, VisualCanvasImageFit fit = Stretch, double opacity = 1, RasterDecodeOptions? options = null) #Decodes image bytes within the requested limits and draws them using anchor-based placement.
Parameters
- data byte[]
- placement ChartForgeX.Composition.VisualCanvasPlacement
- width double
- height double
- fit ChartForgeX.Composition.VisualCanvasImageFit = Stretch
- opacity double = 1
- options ChartForgeX.Raster.RasterDecodeOptions? = null
Returns
ImageCompositionpublic ImageComposition DrawImageFile(string path, double x, double y, double width, double height, VisualCanvasImageFit fit = Stretch, double opacity = 1, RasterDecodeOptions? options = null) #Reads and decodes an image file within the requested limits and draws it into an explicit destination rectangle.
Parameters
- path string
- x double
- y double
- width double
- height double
- fit ChartForgeX.Composition.VisualCanvasImageFit = Stretch
- opacity double = 1
- options ChartForgeX.Raster.RasterDecodeOptions? = null
Returns
ImageCompositionpublic ImageComposition DrawImageFile(string path, VisualCanvasPlacement placement, double width, double height, VisualCanvasImageFit fit = Stretch, double opacity = 1, RasterDecodeOptions? options = null) #Reads and decodes an image file within the requested limits and draws it using anchor-based placement.
Parameters
- path string
- placement ChartForgeX.Composition.VisualCanvasPlacement
- width double
- height double
- fit ChartForgeX.Composition.VisualCanvasImageFit = Stretch
- opacity double = 1
- options ChartForgeX.Raster.RasterDecodeOptions? = null
Returns
ImageCompositionpublic ImageComposition DrawLayer(CapturedVisualLayer layer, double x, double y, VisualBlendMode blendMode, bool orderedDither = true, CancellationToken cancellationToken = default) #Composites a fixed-grid layer over the current destination using one explicitly selected sRGB operator.
Parameters
- layer ChartForgeX.Rendering.CapturedVisualLayer
- Immutable native capture; Source remains its original prepared child.
- x double
- Original child's destination left edge in logical composition units.
- y double
- Original child's destination top edge in logical composition units.
- blendMode ChartForgeX.Effects.VisualBlendMode
- Required explicit gamma-sRGB blend. Standard modes use source-over alpha; PlusLighter adds and clamps premultiplied color and alpha.
- orderedDither bool = true
- Existing final RGBA8 Bayer quantization, anchored to destination device coordinates.
- cancellationToken System.Threading.CancellationToken = default
- Cancels before the final atomic replacement; rejected or canceled requests leave this composition unchanged.
public ImageComposition DrawLayer(CapturedVisualLayer source, double x, double y, VisualCompositeOperator operation, bool orderedDither = true, CancellationToken cancellationToken = default) #Composites one explicit captured source over this destination frame with a selected alpha operator.
Parameters
- source ChartForgeX.Rendering.CapturedVisualLayer
- Immutable fixed-density native capture.
- x double
- Original child's left edge in composition logical coordinates.
- y double
- Original child's top edge in composition logical coordinates.
- operation ChartForgeX.Effects.VisualCompositeOperator
- Required explicit Porter-Duff operation; blending remains a separate overload.
- orderedDither bool = true
- Uses the existing final RGBA8 Bayer quantizer; Copy preserves exact raw source bytes.
- cancellationToken System.Threading.CancellationToken = default
- Cancels before final atomic replacement, leaving the composition unchanged.
public ImageComposition DrawLayer(CapturedVisualLayer layer, double x, double y) #Draws one immutable captured native layer, placing its selected source frame at x/y and retaining effect overflow.
Parameters
- layer ChartForgeX.Rendering.CapturedVisualLayer
- A completed explicit capture; its private pixels are borrowed without modification.
- x double
- Destination position of the original child's left edge in composition logical units.
- y double
- Destination position of the original child's top edge in composition logical units.
public ImageComposition DrawLine(double x0, double y0, double x1, double y1, ChartColor color, double thickness = 1) #Draws a line segment.
Parameters
- x0 double
- y0 double
- x1 double
- y1 double
- color ChartForgeX.Primitives.ChartColor
- thickness double = 1
Returns
ImageCompositionpublic ImageComposition DrawProgressRing(double centerX, double centerY, double radius, double thickness, double fraction, ChartColor trackColor, ChartColor color, double startAngle = -90) #Draws a progress ring: a full track with a round-capped arc over it that covers fraction of the ring, clockwise from startAngle degrees (-90 is twelve o'clock). A fraction of zero draws only the track; one or more fills the ring.
Parameters
- centerX double
- centerY double
- radius double
- thickness double
- fraction double
- trackColor ChartForgeX.Primitives.ChartColor
- color ChartForgeX.Primitives.ChartColor
- startAngle double = -90
Returns
ImageCompositionpublic ImageComposition DrawShadow(ChartColor color, int offsetX, int offsetY, double sigmaX, double? sigmaY = null, CancellationToken cancellationToken = default) #Draws a tinted, blurred alpha shadow beneath the complete current source exactly once.
Parameters
- color ChartForgeX.Primitives.ChartColor
- Resolved literal tint, including opacity applied once to the captured source alpha.
- offsetX int
- Signed horizontal offset in stored device pixels.
- offsetY int
- Signed vertical offset in stored device pixels.
- sigmaX double
- Horizontal three-box Gaussian-approximation target in stored device pixels, from zero through 128.
- sigmaY double? = null
- Vertical target; null uses the horizontal target.
- cancellationToken System.Threading.CancellationToken = default
- Cancels before the final pixel replacement.
public ImageComposition DrawText(double x, double y, double width, string text, double fontSize, ChartColor color, TextAlignment alignment = Left, bool emphasized = false) #Draws text inside a fixed-width region.
Parameters
- x double
- y double
- width double
- text string
- fontSize double
- color ChartForgeX.Primitives.ChartColor
- alignment ChartForgeX.Typography.TextAlignment = Left
- emphasized bool = false
Returns
ImageCompositionpublic ImageComposition DrawText(double x, double y, double width, string text, TextStyle style, TextWrapMode wrapMode = Word, int? maximumLines = null, TextTrimming trimming = Ellipsis) #Draws measured and optionally wrapped text with the shared dependency-free typography engine.
Parameters
- x double
- y double
- width double
- text string
- style ChartForgeX.Typography.TextStyle
- wrapMode ChartForgeX.Typography.TextWrapMode = Word
- maximumLines int? = null
- trimming ChartForgeX.Typography.TextTrimming = Ellipsis
Returns
ImageCompositionpublic double DrawTextHeader(double x, double y, double width, string? title, string? note, TextStyle titleStyle, TextStyle? noteStyle = null, double gap = 12) #Draws a single-row left title and right note, trimming the title to the space left by the note.
Parameters
- x double
- Left edge of the header.
- y double
- Top edge of the header.
- width double
- Available width in pixels.
- title string?
- Optional title. Its configured text-case transform is applied once.
- note string?
- Optional right-aligned note, given priority when space is limited.
- titleStyle ChartForgeX.Typography.TextStyle
- Typography and color for the title. The supplied instance is not changed.
- noteStyle ChartForgeX.Typography.TextStyle? = null
- Optional note style. When omitted, the title style is used without its casing transform.
- gap double = 12
- Minimum separation between the two pieces of text.
Returns
double The occupied height, or zero when neither piece of text can be displayed.public ImageComposition DrawTextLayout(double x, double y, double width, TextLayout layout, TextStyle style) #Draws an existing measured layout without wrapping or applying its text-case transform again.
Parameters
- x double
- y double
- width double
- layout ChartForgeX.Typography.TextLayout
- style ChartForgeX.Typography.TextStyle
Returns
ImageCompositionpublic ImageComposition DrawTopology(TopologyChart topology, double x, double y, double width, double height, TopologyRenderOptions? options = null, VisualCanvasImageFit fit = Stretch, double opacity = 1) #Draws a topology chart layer.
Parameters
- topology ChartForgeX.Topology.TopologyChart
- x double
- y double
- width double
- height double
- options ChartForgeX.Topology.TopologyRenderOptions? = null
- fit ChartForgeX.Composition.VisualCanvasImageFit = Stretch
- opacity double = 1
Returns
ImageCompositionpublic ImageComposition DrawTopology(TopologyChart topology, VisualCanvasPlacement placement, double width, double height, TopologyRenderOptions? options = null, VisualCanvasImageFit fit = Stretch, double opacity = 1) #Draws a topology chart layer using anchor-based placement.
Parameters
- topology ChartForgeX.Topology.TopologyChart
- placement ChartForgeX.Composition.VisualCanvasPlacement
- width double
- height double
- options ChartForgeX.Topology.TopologyRenderOptions? = null
- fit ChartForgeX.Composition.VisualCanvasImageFit = Stretch
- opacity double = 1
Returns
ImageCompositionpublic ImageComposition DrawVisualBlock(IVisualBlock block, double x, double y, double width, double height, VisualCanvasImageFit fit = Stretch, double opacity = 1) #Draws a visual block layer.
Parameters
- block ChartForgeX.VisualBlocks.IVisualBlock
- x double
- y double
- width double
- height double
- fit ChartForgeX.Composition.VisualCanvasImageFit = Stretch
- opacity double = 1
Returns
ImageCompositionpublic ImageComposition DrawVisualBlock(IVisualBlock block, VisualCanvasPlacement placement, double width, double height, VisualCanvasImageFit fit = Stretch, double opacity = 1) #Draws a visual block layer using anchor-based placement.
Parameters
- block ChartForgeX.VisualBlocks.IVisualBlock
- placement ChartForgeX.Composition.VisualCanvasPlacement
- width double
- height double
- fit ChartForgeX.Composition.VisualCanvasImageFit = Stretch
- opacity double = 1
Returns
ImageCompositionpublic ImageComposition DrawVisualCanvas(VisualCanvas canvas, double x, double y, double width, double height, VisualCanvasImageFit fit = Stretch, double opacity = 1) #Draws a visual canvas layer.
Parameters
- canvas ChartForgeX.Composition.VisualCanvas
- x double
- y double
- width double
- height double
- fit ChartForgeX.Composition.VisualCanvasImageFit = Stretch
- opacity double = 1
Returns
ImageCompositionpublic ImageComposition DrawVisualCanvas(VisualCanvas canvas, VisualCanvasPlacement placement, double width, double height, VisualCanvasImageFit fit = Stretch, double opacity = 1) #Draws a visual canvas layer using anchor-based placement.
Parameters
- canvas ChartForgeX.Composition.VisualCanvas
- placement ChartForgeX.Composition.VisualCanvasPlacement
- width double
- height double
- fit ChartForgeX.Composition.VisualCanvasImageFit = Stretch
- opacity double = 1
Returns
ImageCompositionpublic ImageComposition DrawVisualGrid(VisualGrid grid, double x, double y, double width, double height, VisualCanvasImageFit fit = Stretch, double opacity = 1) #Draws a visual grid layer.
Parameters
- grid ChartForgeX.VisualBlocks.VisualGrid
- x double
- y double
- width double
- height double
- fit ChartForgeX.Composition.VisualCanvasImageFit = Stretch
- opacity double = 1
Returns
ImageCompositionpublic ImageComposition DrawVisualGrid(VisualGrid grid, VisualCanvasPlacement placement, double width, double height, VisualCanvasImageFit fit = Stretch, double opacity = 1) #Draws a visual grid layer using anchor-based placement.
Parameters
- grid ChartForgeX.VisualBlocks.VisualGrid
- placement ChartForgeX.Composition.VisualCanvasPlacement
- width double
- height double
- fit ChartForgeX.Composition.VisualCanvasImageFit = Stretch
- opacity double = 1
Returns
ImageCompositionpublic ImageComposition FillCircle(double centerX, double centerY, double radius, ChartColor color) #Draws a filled, antialiased circle.
Parameters
- centerX double
- centerY double
- radius double
- color ChartForgeX.Primitives.ChartColor
Returns
ImageCompositionpublic ImageComposition FillDotPattern(ChartColor color, int spacing = 48, double radius = 1, double? offset = null) #Overlays a regular grid of antialiased dots across this composition.
Parameters
- color ChartForgeX.Primitives.ChartColor
- Dot color, including its alpha.
- spacing int = 48
- Distance between dot centers in pixels; at least one.
- radius double = 1
- Dot radius in pixels.
- offset double? = null
- First center on both axes, from zero up to the spacing. Defaults to half the spacing.
Returns
ImageCompositionpublic ImageComposition FillEllipse(double centerX, double centerY, double radiusX, double radiusY, ChartColor color) #Draws a filled, antialiased ellipse.
Parameters
- centerX double
- centerY double
- radiusX double
- radiusY double
- color ChartForgeX.Primitives.ChartColor
Returns
ImageCompositionpublic ImageComposition FillGridPattern(ChartColor color, int spacing = 48, double thickness = 1, int? offset = null) #Overlays evenly spaced horizontal and vertical lines across this composition.
Parameters
- color ChartForgeX.Primitives.ChartColor
- Line color, including its alpha. Intersections receive both lines.
- spacing int = 48
- Distance between lines in pixels; at least one.
- thickness double = 1
- Line thickness in pixels.
- offset int? = null
- First line coordinate, from zero up to the spacing. Defaults to half the spacing, rounded down.
Returns
ImageCompositionpublic ImageComposition FillRectangle(double x, double y, double width, double height, ChartColor color) #Draws a filled rectangle.
Parameters
- x double
- y double
- width double
- height double
- color ChartForgeX.Primitives.ChartColor
Returns
ImageCompositionpublic ImageComposition FillRectangleLinearGradient(double x, double y, double width, double height, ChartColor startColor, ChartColor endColor, double angle = 90, double radius = 0) #Fills a rectangle with a two-color linear gradient. The angle is in degrees: 0 runs left to right and 90 (the default) runs top to bottom. A positive radius rounds the corners.
Parameters
- x double
- y double
- width double
- height double
- startColor ChartForgeX.Primitives.ChartColor
- endColor ChartForgeX.Primitives.ChartColor
- angle double = 90
- radius double = 0
Returns
ImageCompositionpublic ImageComposition FillRectangleRadialGradient(double x, double y, double width, double height, double gradientCenterX, double gradientCenterY, double gradientRadius, ChartColor innerColor, ChartColor outerColor, double radius = 0) #Fills a rectangle with a two-color radial gradient: innerColor at the gradient center fading to outerColor at gradientRadius and beyond. The center is in composition coordinates and may lie outside the rectangle. A positive radius rounds the corners.
Parameters
- x double
- y double
- width double
- height double
- gradientCenterX double
- gradientCenterY double
- gradientRadius double
- innerColor ChartForgeX.Primitives.ChartColor
- outerColor ChartForgeX.Primitives.ChartColor
- radius double = 0
Returns
ImageCompositionpublic ImageComposition FillRoundedRectangle(double x, double y, double width, double height, double radius, ChartColor color) #Draws a filled rounded rectangle.
Parameters
- x double
- y double
- width double
- height double
- radius double
- color ChartForgeX.Primitives.ChartColor
Returns
ImageCompositionpublic static ImageComposition FromBytes(byte[] data, RasterDecodeOptions? options = null) #Loads image bytes within the requested decode limits and creates a composition with the decoded pixels.
Parameters
- data byte[]
- options ChartForgeX.Raster.RasterDecodeOptions? = null
Returns
ImageCompositionpublic static ImageComposition FromFile(string path, RasterDecodeOptions? options = null) #Reads an image file within the requested encoded-byte and pixel limits and creates a composition with the decoded pixels.
Parameters
- path string
- options ChartForgeX.Raster.RasterDecodeOptions? = null
Returns
ImageCompositionpublic static ImageComposition FromImage(RgbaImage image) #Creates a composition initialized with an independent copy of the supplied image pixels.
Parameters
- image ChartForgeX.Raster.RgbaImage
Returns
ImageCompositionpublic ImageComposition Outline(VisualOutline effect, CancellationToken cancellationToken = default) #Adds only the square-kernel alpha band outside the current source, clipped to this fixed frame.
Parameters
- effect ChartForgeX.Effects.VisualOutline
- Logical radius and tint. Zero radius or zero tint alpha preserves raw source pixels.
- cancellationToken System.Threading.CancellationToken = default
- Cancellation leaves the destination unchanged until one final commit.
public void Save(string path, RasterImageFormat format, RasterImageOptions? options = null) #Saves the composition to a raster file using an explicit format.
Parameters
- path string
- format ChartForgeX.Core.RasterImageFormat
- options ChartForgeX.Core.RasterImageOptions? = null
public void Save(string path, RasterImageOptions? options = null) #Saves the composition to a raster file using the output extension to choose the format.
Parameters
- path string
- options ChartForgeX.Core.RasterImageOptions? = null
public ImageComposition StrokeCircle(double centerX, double centerY, double radius, ChartColor color, double thickness = 1) #Draws an antialiased circle outline centered on the radius.
Parameters
- centerX double
- centerY double
- radius double
- color ChartForgeX.Primitives.ChartColor
- thickness double = 1
Returns
ImageCompositionpublic ImageComposition StrokeEllipse(double centerX, double centerY, double radiusX, double radiusY, ChartColor color, double thickness = 1) #Draws an antialiased ellipse outline centered on the radii.
Parameters
- centerX double
- centerY double
- radiusX double
- radiusY double
- color ChartForgeX.Primitives.ChartColor
- thickness double = 1
Returns
ImageCompositionpublic ImageComposition StrokeRectangle(double x, double y, double width, double height, ChartColor color, double thickness = 1) #Draws a rectangle outline.
Parameters
- x double
- y double
- width double
- height double
- color ChartForgeX.Primitives.ChartColor
- thickness double = 1
Returns
ImageCompositionpublic ImageComposition StrokeRoundedRectangle(double x, double y, double width, double height, double radius, ChartColor color, double thickness = 1) #Draws a rounded rectangle outline.
Parameters
- x double
- y double
- width double
- height double
- radius double
- color ChartForgeX.Primitives.ChartColor
- thickness double = 1
Returns
ImageCompositionpublic byte[] ToJpeg(RasterImageOptions? options = null) #Encodes the composition to JPEG bytes.
Parameters
- options ChartForgeX.Core.RasterImageOptions? = null
Returns
byte[]public byte[] ToPng(RasterImageOptions? options) #Encodes the composition to PNG bytes using dependency-free raster options.
Parameters
- options ChartForgeX.Core.RasterImageOptions?
Returns
byte[]public byte[] ToRasterImage(RasterImageFormat format, RasterImageOptions? options = null) #Encodes the composition to a static dependency-free raster format.
Parameters
- format ChartForgeX.Core.RasterImageFormat
- options ChartForgeX.Core.RasterImageOptions? = null
Returns
byte[]public static bool TryFromBytes(byte[]? data, out ImageComposition? composition, RasterDecodeOptions? options = null) #Attempts to load image bytes and create a composition with the decoded pixels.
Parameters
- data byte[]?
- composition ChartForgeX.Composition.ImageComposition?
- options ChartForgeX.Raster.RasterDecodeOptions? = null
Returns
boolpublic static bool TryFromFile(string? path, out ImageComposition? composition, RasterDecodeOptions? options = null) #Attempts to load an image file and create a composition with the decoded pixels.
Parameters
- path string?
- composition ChartForgeX.Composition.ImageComposition?
- options ChartForgeX.Raster.RasterDecodeOptions? = null
Returns
boolpublic void Write(Stream stream, RasterImageFormat format, RasterImageOptions? options = null) #Writes the composition to a raster stream.
Parameters
- stream System.IO.Stream
- format ChartForgeX.Core.RasterImageFormat
- options ChartForgeX.Core.RasterImageOptions? = null