Click or drag to resize
Ab4d.SharpEngine logo

SceneView.RenderToGpuBuffer Method

Renders the current scene view to the bitmap and saves the image data a GpuBuffer that is passed to the specified stagingGpuBufferReady Action (parameters: GpuBuffer gpuBuffer, int imageWidth, int imageHeight). The data in the GpuBuffer always have 4 bytes per pixel and have no row padding (stride = width * 4). To render to a different size or different multi-sample or super-sampling count, create a new SceneView and call RenderToGpuBuffer there.

Namespace: Ab4d.SharpEngine
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 3.0.9208+3b2441d6a11f923f2600f40f4296bdc3d8b46035
Syntax
C#
public void RenderToGpuBuffer(
	bool renderNewFrame = true,
	bool preserveGpuImage = true,
	StandardBitmapFormats format = StandardBitmapFormats.Undefined,
	Action<GpuBuffer, int, int>? stagingGpuImageReady = null
)

Parameters

renderNewFrame  Boolean  (Optional)
renders a new frame before creating a bitmap (true by default)
preserveGpuImage  Boolean  (Optional)
when true then the GpuImage is preserved for the next call of RenderToBitmap. When false then the used GpuImage is disposed before returning from this method. (false by default).
format  StandardBitmapFormats  (Optional)
format of the rendered bitmap (Undefined by default - in this case the value of the SceneView.Format is used)
stagingGpuImageReady  Action<GpuBuffer, Int32, Int32>  (Optional)
Action that will be called when the GpuBuffer is ready (action parameters: GpuBuffer gpuBuffer, int imageWidth, int imageHeight)
See Also