Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

OfficeRasterImage

OfficeIMO.Drawing

Namespace
OfficeIMO.Drawing
Assembly
OfficeIMO.Core
Source revision
ba882f6b0d07 with working tree changes
Modifiers
sealed

Dependency-free RGBA raster image buffer.

Inheritance

  • object
  • OfficeRasterImage

Remarks

Pixels use tightly packed, top-to-bottom, straight-alpha RGBA bytes. The mutable image is not thread-safe. Pixel writes outside the canvas are clipped; pixel reads require in-bounds coordinates.

Usage

Explore 116 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 44

Accepted by parameters 72

Constructors

public OfficeRasterImage(int width, int height, OfficeColor? background = null) #

Creates a new RGBA image buffer.

Parameters

width int required
height int required
background OfficeIMO.OfficeColor? = null optional

Methods

public void BlendPixel(int x, int y, OfficeColor color) #

Alpha blends a pixel over the current pixel. Coordinates outside the canvas are ignored.

Parameters

x int required
y int required
color OfficeIMO.OfficeColor required
public OfficeRasterImage Clone() #

Returns an independent image with the same dimensions and RGBA samples.

public void Fill(OfficeColor color) #

Fills the whole image with a color.

Parameters

color OfficeIMO.OfficeColor required
public static OfficeRasterImage FromRgba32(int width, int height, byte[] pixels) #

Creates an image from tightly packed, top-to-bottom RGBA bytes, copying the caller's buffer.

Parameters

width int required
height int required
pixels byte[] required
public OfficeColor GetPixel(int x, int y) #

Gets the color of a pixel.

Parameters

x int required
y int required
public byte[] GetPixels() #

Returns an independent copy of the tightly packed RGBA pixels.

Returns

byte[]
public void SetPixel(int x, int y, OfficeColor color) #

Sets a pixel without alpha blending. Coordinates outside the canvas are ignored.

Parameters

x int required
y int required
color OfficeIMO.OfficeColor required

Properties

public int Width { get; } #

Image width in pixels.

public int Height { get; } #

Image height in pixels.