Possible to modify MoI Save Screenshot script?
All  1  2-3

Previous
Next
 From:  Michael Gibson
9787.2 In reply to 9787.1 
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
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  ed (EDDYF)
9787.3 In reply to 9787.2 
That works awesome Michael. Very clean output. Thank you!

Now I have two options for taking a screen shot. This will work well for making a label mask and opacity mask for the render program.

Ed Ferguson
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All

 

 
 
Show messages: All  1  2-3