Hi Ed, so the moi.view.screenshot() method takes a snapshot of the desktop image. There is a different method which will make a bitmap image and draw the viewport into that image. That can be good because you can generate a different resolution than your desktop screen and things like floating windows won't get captured in the image either.
Try this one, it will also change the viewport background color and turn off those different decorations, then generate the image and then reset those things.
script: var prev_background = moi.view.viewportBackgroundColor; moi.view.viewportBackgroundColor = 0xFFFFFF; moi.view.lineWidth = 4; moi.grid.display = false; moi.grid.showXYAxes = false; moi.view.showAxisIcon = false; moi.view.showViewTitles = false; var img = null; try { img = moi.ui.getActiveViewport().render( 4000, 2500 ); } catch(e){} moi.view.lineWidth = 1; moi.grid.display = true; moi.grid.showXYAxes = true; moi.view.showAxisIcon = true; moi.view.showViewTitles = true; moi.view.viewportBackgroundColor = prev_background; var name = img.getSaveFileName(); if ( name != '' ) img.save( name );
- Michael
|