CreatePreviewImage

Creates a bitmap preview image of the current model.

Syntax

rhinoscriptsyntax.CreatePreviewImage (filename, view=None, size=None, flags=0, wireframe=False)

rhinoscript.document.CreatePreviewImage (filename, view=None, size=None, flags=0, wireframe=False)

Parameters

filename

Required. String. The name of the bitmap file to create.  The extension of the filename controls the format of the bitmap file created.

Type

Description

bmp

Windows Bitmap

tga

Truevision Targa

jpg, jpeg

JPEG Compliant

pcx

Zsoft Paintbrush

png

Portable Network Graphics

tif, tiff

Tagged Image File Format

view

Optional.  String.  The title of the view.  If omitted, the current active view is used.

size

Optional.  Tuple or list.  A tuple or list of two integers that specify the width and height of the bitmap in pixels.

flags

Optional.  Integer.  The bitmap creation flags. This parameter can be a combination of the following:

Value

Description

1

Honor object highlighting.  The default is to ignore highlighting (False).

2

Draw construction plane.  The default is not to draw the construction plane (False).

4

Use ghosted shading.  The default is to use the view's default display mode (False).

wireframe

Optional.  Boolean.  If specified and True, then a wireframe preview image, instead of a rendered image, will be created. Note, if this option is specified and True, then the ghosted shading flag is ignored.  The default value is False.

Returns

Boolean

True or False indicating success or failure.

Example

import rhinoscriptsyntax as rs

result = rs.CreatePreviewImage("test.jpg")

if result:

    print "test.jpg created successfully."

else:

    print "Unable to create preview image."

Also See

ExtractPreviewImage