NXOpen C++ Reference Guide
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Types | Public Member Functions | List of all members
NXOpen::Gateway::ImageExportBuilder Class Reference

Captures the image in the active graphics window (or in a rectangular region of the active graphics window), and then exports/saves the image in a file of a specified format. More...

Inheritance diagram for NXOpen::Gateway::ImageExportBuilder:
NXOpen::Builder NXOpen::TaggedObject NXOpen::GeometricUtilities::IComponentBuilder

Public Types

enum  BackgroundOptions { BackgroundOptionsOriginal, BackgroundOptionsCustomColor, BackgroundOptionsTransparent }
 The background style of the captured image. More...
 
enum  FileFormats {
  FileFormatsPng, FileFormatsJpg, FileFormatsGif, FileFormatsTiff,
  FileFormatsBmp, FileFormatsXwd
}
 The format of the exported image file. More...
 

Public Member Functions

NXOpen::Gateway::ImageExportBuilder::BackgroundOptions BackgroundOption ()
 Returns. More...
 
bool EnhanceEdges ()
 Returns. More...
 
NXOpen::Gateway::ImageExportBuilder::FileFormats FileFormat ()
 Returns. More...
 
NXString FileName ()
 Returns. More...
 
std::vector< double > GetCustomBackgroundColor ()
 Returns the background color the image will be captured with if Gateway::ImageExportBuilder::BackgroundOption and Gateway::ImageExportBuilder::SetBackgroundOption is set to Custom Color. More...
 
std::vector< int > GetRegionTopLeftPoint ()
 Returns the top left point of the region of the graphics window that will be captured if Gateway::ImageExportBuilder::RegionMode and Gateway::ImageExportBuilder::SetRegionMode is true. More...
 
int RegionHeight ()
 Returns. More...
 
bool RegionMode ()
 Returns. More...
 
int RegionWidth ()
 Returns. More...
 
void SetBackgroundOption (NXOpen::Gateway::ImageExportBuilder::BackgroundOptions backgroundOption)
 Sets. More...
 
void SetCustomBackgroundColor (const std::vector< double > &customBackgroundColor)
 Sets the background color the image will be captured with if Gateway::ImageExportBuilder::BackgroundOption and Gateway::ImageExportBuilder::SetBackgroundOption is set to Custom Color. More...
 
void SetEnhanceEdges (bool enhanceEdges)
 Sets. More...
 
void SetFileFormat (NXOpen::Gateway::ImageExportBuilder::FileFormats fileFormat)
 Sets. More...
 
void SetFileName (const NXString &fileName)
 Sets. More...
 
void SetFileName (const char *fileName)
 Sets. More...
 
void SetRegionHeight (int regionHeight)
 Sets. More...
 
void SetRegionMode (bool regionMode)
 Sets. More...
 
void SetRegionTopLeftPoint (const std::vector< int > &regionTopLeftPoint)
 Sets the top left point of the region of the graphics window that will be captured if Gateway::ImageExportBuilder::RegionMode and Gateway::ImageExportBuilder::SetRegionMode is true. More...
 
void SetRegionWidth (int regionWidth)
 Sets. More...
 
- Public Member Functions inherited from NXOpen::Builder
NXOpen::NXObjectCommit ()
 Commits any edits that have been applied to the builder. More...
 
void Destroy ()
 Deletes the builder, and cleans up any objects created by the builder. More...
 
std::vector< NXOpen::NXObject * > GetCommittedObjects ()
 For builders that create more than one object, this method returns the objects that are created by commit. More...
 
NXOpen::NXObjectGetObject ()
 Returns the object currently being edited by this builder. More...
 
void ShowResults ()
 Updates the model to reflect the result of an edit to the model for all builders that support showing results. More...
 
virtual bool Validate ()
 Validate whether the inputs to the component are sufficient for commit to be called. More...
 
- Public Member Functions inherited from NXOpen::TaggedObject
tag_t Tag () const
 Returns the tag of this object. More...
 

Detailed Description

Captures the image in the active graphics window (or in a rectangular region of the active graphics window), and then exports/saves the image in a file of a specified format.

This class can be used to export an image file that contains the contents of the active graphics window. The image may be limited to a rectangular region of the display via Gateway::ImageExportBuilder::SetRegionMode . Gateway::ImageExportBuilder::FileFormats enumerates the file formats exported images may be saved in. The background of the exported image may be changed to any of the options available in Gateway::ImageExportBuilder::BackgroundOptions . After configuring the image export, an image file is saved by calling the Commit method.


To create a new instance of this class, use NXOpen::UI::CreateImageExportBuilder
Default values.

Property Value

BackgroundOption

Original

FileFormat

Png


Created in NX12.0.1.

Member Enumeration Documentation

The background style of the captured image.

Enumerator
BackgroundOptionsOriginal 

Use the currently displayed background.

BackgroundOptionsCustomColor 

Use the solid color set by Gateway::ImageExportBuilder::SetCustomBackgroundColor.

BackgroundOptionsTransparent 

Use a transparent background (only available in PNG and TIFF file formats)

The format of the exported image file.

Enumerator
FileFormatsPng 

PNG File Format.

FileFormatsJpg 

JPG File Format.

FileFormatsGif 

GIF File Format.

FileFormatsTiff 

Compressed TIFF File Format.

FileFormatsBmp 

BMP File Format (Windows Only)

FileFormatsXwd 

XWD File Format (Unix Only)

Member Function Documentation

NXOpen::Gateway::ImageExportBuilder::BackgroundOptions NXOpen::Gateway::ImageExportBuilder::BackgroundOption ( )

Returns.

the background style used when capturing the image.

The image may be captured with any of the background styles enumerated in Gateway::ImageExportBuilder::BackgroundOptions . If the Custom Color background option is used, the background color may be specified with Gateway::ImageExportBuilder::SetCustomBackgroundColor .


Created in NX12.0.1.

License requirements : None

bool NXOpen::Gateway::ImageExportBuilder::EnhanceEdges ( )

Returns.

a boolean value that, if true, indicates the image will be captured with antialiasing disabled and edge emphasis enabled.

When capturing an image with many edges, such as a wireframe view of a part, antialiasing may cause thin edges to blur with the background of the image. This effect may be particularly noticeable when using a transparent background. Disabling antialiasing and enabling edge emphasis helps to eliminate this blurring at the cost of a more pixelated image.


Created in NX12.0.1.

License requirements : None

NXOpen::Gateway::ImageExportBuilder::FileFormats NXOpen::Gateway::ImageExportBuilder::FileFormat ( )

Returns.

the file format of the exported image file.

The exported image may be stored in any of the file formats enumerated in Gateway::ImageExportBuilder::FileFormats . Please note that transparency is only available in TIFF and PNG formats.


Created in NX12.0.1.

License requirements : None

NXString NXOpen::Gateway::ImageExportBuilder::FileName ( )

Returns.

the full path of the exported image file.

This value should be set to the desired destination of the exported image file.


Created in NX12.0.1.

License requirements : None

std::vector<double> NXOpen::Gateway::ImageExportBuilder::GetCustomBackgroundColor ( )

Returns the background color the image will be captured with if Gateway::ImageExportBuilder::BackgroundOption and Gateway::ImageExportBuilder::SetBackgroundOption is set to Custom Color.

Returns
Array of 3 RGB values, each between 0 and 1
Created in NX12.0.1.

License requirements : None
std::vector<int> NXOpen::Gateway::ImageExportBuilder::GetRegionTopLeftPoint ( )

Returns the top left point of the region of the graphics window that will be captured if Gateway::ImageExportBuilder::RegionMode and Gateway::ImageExportBuilder::SetRegionMode is true.

This value is a window coordinate. See Gateway::ImageExportBuilder::RegionMode and Gateway::ImageExportBuilder::SetRegionMode for more information on capturing a region of the graphics window.

Returns
Array of 2 int values representing the x and y window coordinate of the top left point of the captured region
Created in NX12.0.1.

License requirements : None
int NXOpen::Gateway::ImageExportBuilder::RegionHeight ( )

Returns.

the height of the region of the graphics window that will be captured if Gateway::ImageExportBuilder::RegionMode and Gateway::ImageExportBuilder::SetRegionMode is true.

See Gateway::ImageExportBuilder::RegionMode and Gateway::ImageExportBuilder::SetRegionMode for more information on capturing a region of the graphics window.


Created in NX12.0.1.

License requirements : None

bool NXOpen::Gateway::ImageExportBuilder::RegionMode ( )

Returns.

a boolean value that, if true, indicates that a rectangular region of the graphics window will be captured, rather than the entire graphics window.

The region used to generate the image file is defined using Gateway::ImageExportBuilder::SetRegionTopLeftPoint , Gateway::ImageExportBuilder::SetRegionWidth and Gateway::ImageExportBuilder::SetRegionHeight .


Created in NX12.0.1.

License requirements : None

int NXOpen::Gateway::ImageExportBuilder::RegionWidth ( )

Returns.

the width of the region of the graphics window that will be captured if Gateway::ImageExportBuilder::RegionMode and Gateway::ImageExportBuilder::SetRegionMode is true.

See Gateway::ImageExportBuilder::RegionMode and Gateway::ImageExportBuilder::SetRegionMode for more information on capturing a region of the graphics window.


Created in NX12.0.1.

License requirements : None

void NXOpen::Gateway::ImageExportBuilder::SetBackgroundOption ( NXOpen::Gateway::ImageExportBuilder::BackgroundOptions  backgroundOption)

Sets.

the background style used when capturing the image.

The image may be captured with any of the background styles enumerated in Gateway::ImageExportBuilder::BackgroundOptions . If the Custom Color background option is used, the background color may be specified with Gateway::ImageExportBuilder::SetCustomBackgroundColor .


Created in NX12.0.1.

License requirements : None

Parameters
backgroundOptionbackgroundoption
void NXOpen::Gateway::ImageExportBuilder::SetCustomBackgroundColor ( const std::vector< double > &  customBackgroundColor)

Sets the background color the image will be captured with if Gateway::ImageExportBuilder::BackgroundOption and Gateway::ImageExportBuilder::SetBackgroundOption is set to Custom Color.


Created in NX12.0.1.

License requirements : None

Parameters
customBackgroundColorArray of 3 RGB values, each between 0 and 1
void NXOpen::Gateway::ImageExportBuilder::SetEnhanceEdges ( bool  enhanceEdges)

Sets.

a boolean value that, if true, indicates the image will be captured with antialiasing disabled and edge emphasis enabled.

When capturing an image with many edges, such as a wireframe view of a part, antialiasing may cause thin edges to blur with the background of the image. This effect may be particularly noticeable when using a transparent background. Disabling antialiasing and enabling edge emphasis helps to eliminate this blurring at the cost of a more pixelated image.


Created in NX12.0.1.

License requirements : None

Parameters
enhanceEdgesenhanceedges
void NXOpen::Gateway::ImageExportBuilder::SetFileFormat ( NXOpen::Gateway::ImageExportBuilder::FileFormats  fileFormat)

Sets.

the file format of the exported image file.

The exported image may be stored in any of the file formats enumerated in Gateway::ImageExportBuilder::FileFormats . Please note that transparency is only available in TIFF and PNG formats.


Created in NX12.0.1.

License requirements : None

Parameters
fileFormatfileformat
void NXOpen::Gateway::ImageExportBuilder::SetFileName ( const NXString fileName)

Sets.

the full path of the exported image file.

This value should be set to the desired destination of the exported image file.


Created in NX12.0.1.

License requirements : None

Parameters
fileNamefilename
void NXOpen::Gateway::ImageExportBuilder::SetFileName ( const char *  fileName)

Sets.

the full path of the exported image file.

This value should be set to the desired destination of the exported image file.


Created in NX12.0.1.

License requirements : None

Parameters
fileNamefilename
void NXOpen::Gateway::ImageExportBuilder::SetRegionHeight ( int  regionHeight)

Sets.

the height of the region of the graphics window that will be captured if Gateway::ImageExportBuilder::RegionMode and Gateway::ImageExportBuilder::SetRegionMode is true.

See Gateway::ImageExportBuilder::RegionMode and Gateway::ImageExportBuilder::SetRegionMode for more information on capturing a region of the graphics window.


Created in NX12.0.1.

License requirements : None

Parameters
regionHeightregionheight
void NXOpen::Gateway::ImageExportBuilder::SetRegionMode ( bool  regionMode)

Sets.

a boolean value that, if true, indicates that a rectangular region of the graphics window will be captured, rather than the entire graphics window.

The region used to generate the image file is defined using Gateway::ImageExportBuilder::SetRegionTopLeftPoint , Gateway::ImageExportBuilder::SetRegionWidth and Gateway::ImageExportBuilder::SetRegionHeight .


Created in NX12.0.1.

License requirements : None

Parameters
regionModeregionmode
void NXOpen::Gateway::ImageExportBuilder::SetRegionTopLeftPoint ( const std::vector< int > &  regionTopLeftPoint)

Sets the top left point of the region of the graphics window that will be captured if Gateway::ImageExportBuilder::RegionMode and Gateway::ImageExportBuilder::SetRegionMode is true.

This value is a window coordinate. See Gateway::ImageExportBuilder::RegionMode and Gateway::ImageExportBuilder::SetRegionMode for more information on capturing a region of the graphics window.


Created in NX12.0.1.

License requirements : None

Parameters
regionTopLeftPointArray of 2 int values representing the x and y window coordinate of the top left point of the captured region
void NXOpen::Gateway::ImageExportBuilder::SetRegionWidth ( int  regionWidth)

Sets.

the width of the region of the graphics window that will be captured if Gateway::ImageExportBuilder::RegionMode and Gateway::ImageExportBuilder::SetRegionMode is true.

See Gateway::ImageExportBuilder::RegionMode and Gateway::ImageExportBuilder::SetRegionMode for more information on capturing a region of the graphics window.


Created in NX12.0.1.

License requirements : None

Parameters
regionWidthregionwidth

The documentation for this class was generated from the following file:
Copyright 2019 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.