Scripting Resources for DigitalMicrograph™

banner

Dave Mitchell's DigitalMicrograph™ Scripting Website

Home | Scripts | Examples | Functions | Recent Updates | Tutorials | Resources | Publications | Consulting | Projects | Contact & Bio | Private | Search

 

Example: Export an ImageDisplay as an RGB image
Function
An example script which shows how to use the ImageDisplayGetExportImage() to create an RGB image for export.
Version
2015038, v1.0
Author
D. R. G. Mitchell
Acknowledgements
Assistance supplied by Vincent Hou - with thanks.
Comments

This script will get the front-most image and create from its display an RGB image at full resolution. This is a great way of creating an RGB image for export.

 

System Requirements
Should be compatible with all recent versions of DigitalMicrograph.
Known Issues
-
Supported
Yes
Included Files
Main script file.
Source Code

// Example script which shows how to use the ImageDisplayGetExportImage()

// function. This script will get the front-most image and create from its

// display an RGB image at full resolution. This is a great way of creating

// an RGB image for export.

 

// version:20150328, v1.0,

// D. R. G. Mitchell, adminnospam@dmscripting.com (remove the nospam to make this address work)

// March 2015, www.dmscripting.com

 

// Acknowledgements: This code is from Vincent Hou - with thanks. The only ExportMode which

// is supported is 7. This creates an RGB image. No annotations are transferred to the

// resulting RGB image

 

 

// Source the front-most image

 

image img := GetFrontImage()

ImageDisplay clutDisplay, imgDisp = img.ImageGetImageDisplay(0)

number exportMode = 7 // export as a RGB image - other values are not supported

 

 

// clutdisplay is a null imagedisplay

 

RGBImage rgbimg:= ImgDisp.ImageDisplayGetExportImage( exportmode, clutDisplay )

rgbImg.ShowImage()