Std ViewScreenShot: Difference between revisions

From FreeCAD Documentation
No edit summary
No edit summary
Line 1: Line 1:
{{GuiCommand|Name=Std_ViewScreenShot|Workbenches=All|SeeAlso=...}}
{{GuiCommand|Name=Std_ViewScreenShot|MenuLocation=Tools -> Save picture...|Workbenches=All|SeeAlso=...}}
==== Synopsis ====
==== Synopsis ====



Revision as of 10:26, 25 October 2008

Std_ViewScreenShot

Menu location
Tools -> Save picture...
Workbenches
All
Default shortcut
None
Introduced in version
-
See also
...

Synopsis

This command opens a dialog to save the current content of the 3D view to a file. It can save to various image formats. Additionally, you can change the aspect ratio and the resolution of the screen shot using the "Options" button to get access to more parameters.

This command can also use the image comment field of some image formats, like PNG or JPEG to save MIBA information along with the picture.


Dialog


Image Size

The image size parameters are set to the screen size of the active 3D View. But you can change it to any value you like. Some OpenGL driver dont allow renderings greater then 8000 pixels. It depends on your system

With the four buttons you can change the aspect to a certain value.

Image background

With this combo box you can choose the background of the picture you make.

  • Current use the current view background (as chosen in the Preferences)
  • White creates a plain white background (for e.g. printings)
  • Black plain black background
  • Transparent creates a transparend background on image formates which supports transparency
Comment

Some image formates can transport a comment allong the picture. I case you choose one of this formats you can insert a comment or use the comment field for the MIBA information.


Scripting

It's also possible to save the screen by python: <python> Gui.ActiveDocument.ActiveView.saveImage('C:/temp/test.png',1656,783,'Current') </python>

This script makes a series of pictures of different sizes and from different points of view. The type of the camera, i.e. orthographic or perspective can also be changed. <python> import Part,PartGui

  1. loading test part

Part.open("C:/Documents and Settings/jriegel/My Documents/Projects/FreeCAD/data/Blade.stp") OutDir = 'c:/temp/'

  1. creating images with different Views, Cameras and sizes

for p in ["PerspectiveCamera","OrthographicCamera"]:

 Gui.SendMsgToActiveView(p)
 for f in ["ViewAxo","ViewFront","ViewTop"]:
   Gui.SendMsgToActiveView(f)
   for x,y in [[500,500],[1000,3000],[3000,1000],[3000,3000],[8000,8000]]:
     Gui.ActiveDocument.ActiveView.saveImage(OutDir + "Blade_" + p +"_" + f + "_" + `x` + "_" + `y` + ".jpg",x,y,"White")
     Gui.ActiveDocument.ActiveView.saveImage(OutDir + "Blade_" + p +"_" + f + "_" + `x` + "_" + `y` + ".png",x,y,"Transparent")
  1. close active document

App.closeDocument(App.ActiveDocument.Name) </python>