Std ViewScreenShot: Difference between revisions
No edit summary |
No edit summary |
||
Line 2: | Line 2: | ||
'''Synopsis''' |
'''Synopsis''' |
||
This command |
This command opens a dialog to save the current content in the 3D view to |
||
a file. It can save various |
a file. It can save to various image formats. Additionally, you can change the |
||
aspect ratio and the resolution of the screen shot |
aspect ratio and the resolution of the screen shot using the "Extended" |
||
Button to get access to more parameters. |
Button to get access to more parameters. |
||
This command can also use the image comment field of some |
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. |
to save [[MIBA]] information along with the picture. |
||
Line 17: | Line 17: | ||
''' scripting ''' |
''' scripting ''' |
||
It's also possible to save the screen by python: |
|||
<python> |
<python> |
||
Gui. |
Gui.ActiveDocument.ActiveView.saveImage('C:/temp/test.png',1656,783,'Current') |
||
</python> |
</python> |
||
This script makes a series of pictures in different |
This script makes a series of pictures in different sizes and from different |
||
points of view. The type of the camera, i.e. orthographic or perspective can also be changed. |
|||
<python> |
<python> |
||
import Part,PartGui |
import Part,PartGui |
||
Line 36: | Line 36: | ||
Gui.SendMsgToActiveView(f) |
Gui.SendMsgToActiveView(f) |
||
for x,y in [[500,500],[1000,3000],[3000,1000],[3000,3000],[8000,8000]]: |
for x,y in [[500,500],[1000,3000],[3000,1000],[3000,3000],[8000,8000]]: |
||
Gui. |
Gui.ActiveDocument.ActiveView.saveImage(OutDir + "Blade_" + p +"_" + f + "_" + `x` + "_" + `y` + ".jpg",x,y,"White") |
||
Gui. |
Gui.ActiveDocument.ActiveView.saveImage(OutDir + "Blade_" + p +"_" + f + "_" + `x` + "_" + `y` + ".png",x,y,"Transparent") |
||
# close document |
# close document |
Revision as of 09:03, 24 October 2008
Std_ViewScreenShot |
Menu location |
---|
None |
Workbenches |
All |
Default shortcut |
None |
Introduced in version |
- |
See also |
... |
Synopsis
This command opens a dialog to save the current content in 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 "Extended" 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
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 in 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
- loading test part
Part.open("C:/Documents and Settings/jriegel/My Documents/Projects/FreeCAD/data/Blade.stp") OutDir = 'c:/temp/'
- 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")
- close document
App.Close("Unnamed") </python>