Click or drag to resize
AB4D logo

BitmapRenderingRenderToBitmap(FrameworkElement, Brush, Int32, RenderTargetBitmap) Method

Renders FrameworkElement specified with objectToRender to bitmap with specified backgroundBrush and dpi. The size of the created bitmap is the same as the size of the objectToRender.

Namespace: Ab3d.Utilities
Assembly: Ab3d.PowerToys (in Ab3d.PowerToys.dll) Version: 11.0.8585.1045
public static RenderTargetBitmap RenderToBitmap(
	FrameworkElement objectToRender,
	Brush backgroundBrush = null,
	int dpi = 96,
	RenderTargetBitmap renderTargetBitmapToReuse = null


objectToRender  FrameworkElement
FrameworkElement to render
backgroundBrush  Brush  (Optional)
brush used for background or null to have no background. Default value is null.
dpi  Int32  (Optional)
DPI setting for the rendered bitmap. Default value is 96
renderTargetBitmapToReuse  RenderTargetBitmap  (Optional)
when not null and when its size is the same as the size of objectToRender, then the renderTargetBitmapToReuse is cleared and used again to improve memory usage.

Return Value

See Also