PostProcessFrameBufferEventArgs

DrawEventArgsEventArgsReferences
Gives a DisplayPipeline.PostProcessFrameBuffer handler access to the frame that was just drawn.

Properties

Display

public DisplayPipeline Display { get; }
inherited fromDrawEventArgs

FrameBufferSize

#Since v9.0
public Size FrameBufferSize { get; }
Width and height in pixels of the frame this handler can read. A layout runs this channel once per detail, so this is not always the size of the view.

RhinoDoc

public RhinoDoc RhinoDoc { get; }
inherited fromDrawEventArgs

Viewport

public RhinoViewport Viewport { get; }
inherited fromDrawEventArgs

Methods

TryCopyFrameBuffer

#Since v9.0
public bool TryCopyFrameBuffer(byte[] destination, int destinationStride, bool preserveAlpha)
Copies the frame into a caller owned array as 32 bit BGRA. Reuse one array across frames; allocating per frame defeats the point of this event.
destination (byte[])Destination array.
destinationStride (int)Bytes from the start of one destination row to the start of the next. A positive value writes the top row of the image first, a negative value writes the bottom row first.
preserveAlpha (bool)true to copy the alpha channel as the display engine left it. A frame buffer read back can carry an alpha channel the engine never wrote, which makes the whole frame transparent, so pass false unless the alpha is known to be meaningful. Passing true is also the faster of the two copies, since it leaves the alpha channel alone.
true if the frame was copied.

TryCopyFrameBuffer

#Since v9.0
public bool TryCopyFrameBuffer(byte[] destination, int destinationStride)
Copies the frame into a caller owned array as 32 bit BGRA, with every pixel made opaque. Reuse one array across frames; allocating per frame defeats the point of this event.
destination (byte[])Destination array.
destinationStride (int)Bytes from the start of one destination row to the start of the next. A positive value writes the top row of the image first, a negative value writes the bottom row first.
true if the frame was copied.

TryCopyFrameBuffer

#Since v9.0
public bool TryCopyFrameBuffer(nint destination, int destinationStride, int destinationCapacityInBytes, bool preserveAlpha)
Copies the frame into caller owned memory as 32 bit BGRA.
destination (nint)Start of the destination buffer. This is the start of the buffer whichever row order is asked for, unlike the GDI convention of pointing at the last row.
destinationStride (int)Bytes from the start of one destination row to the start of the next. A positive value writes the top row of the image first, a negative value writes the bottom row first.
destinationCapacityInBytes (int)Bytes available at destination.
preserveAlpha (bool)true to copy the alpha channel as the display engine left it. A frame buffer read back can carry an alpha channel the engine never wrote, which makes the whole frame transparent, so pass false unless the alpha is known to be meaningful. Passing true is also the faster of the two copies, since it leaves the alpha channel alone.
true if the frame was copied.

TryCopyFrameBuffer

#Since v9.0
public bool TryCopyFrameBuffer(nint destination, int destinationStride, int destinationCapacityInBytes)
Copies the frame into caller owned memory as 32 bit BGRA, with every pixel made opaque.
destination (nint)Start of the destination buffer. This is the start of the buffer whichever row order is asked for, unlike the GDI convention of pointing at the last row.
destinationStride (int)Bytes from the start of one destination row to the start of the next. A positive value writes the top row of the image first, a negative value writes the bottom row first.
destinationCapacityInBytes (int)Bytes available at destination.
true if the frame was copied.