GetPreviewImage Method


Element Type Get Preview Image Method

Get the preview image of an element. This image is similar to what is seen in the Revit UI when selecting the type of an element.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public virtual Bitmap GetPreviewImage(
	Size size
)

Parameters

size Size
The width and height of the preview image in pixels.

Return Value

Bitmap
System::Drawing::Bitmap represents the preview image. if there is no preview image.
Exceptions
Exception Condition
ArgumentException The width or height of the size is equal or less than zero.
See Also
ArchiLabs Desktop

Put AI to work inside Revit.

Give Desktop your instructions and project files to build Revit families, update model elements, and create views and schedules. Works directly in Revit and AutoCAD.

Explore Desktop →