Std ViewScreenShot/ja: Difference between revisions

From FreeCAD Documentation
(Created page with "またPNGやJPEGといった一部の画像フォーマットでは画像のコメントフィールドを使用して MIBA情報を画像に付加することも...")
(Updating to match new version of source page)
Line 2: Line 2:
{{GuiCommand/jp|Name=Std_ViewScreenShot|MenuLocation=Tools -> Save picture...|Workbenches=All|SeeAlso=...}}
{{GuiCommand/jp|Name=Std_ViewScreenShot|MenuLocation=Tools -> Save picture...|Workbenches=All|SeeAlso=...}}


<div class="mw-translate-fuzzy">

==== 概要 ====
==== 概要 ====


Line 8: Line 8:
このダイアログでは様々な画像フォーマットで保存を行うことができます。
このダイアログでは様々な画像フォーマットで保存を行うことができます。
さらにパラメーターにアクセスするための"Options"ボタンを使ってスクリーンショットの
さらにパラメーターにアクセスするための"Options"ボタンを使ってスクリーンショットの
アスペクト比や解像度を変更することも可能です。
アスペクト比や解像度を変更することも可能です。
</div>


<div class="mw-translate-fuzzy">
またPNGやJPEGといった一部の画像フォーマットでは画像のコメントフィールドを使用して
またPNGやJPEGといった一部の画像フォーマットでは画像のコメントフィールドを使用して
[[MIBA/jp|MIBA]]情報を画像に付加することも可能です。
[[MIBA/jp|MIBA]]情報を画像に付加することも可能です。
</div>


<div class="mw-translate-fuzzy">

==== 画像フォーマット ====
==== 画像フォーマット ====
FreeCADは画像保存のためにQTに組み込まれた画像タイプとbin/imageformatsディレクトリにある一部のQTプラグインを使用しています。
FreeCADは画像保存のためにQTに組み込まれた画像タイプとbin/imageformatsディレクトリにある一部のQTプラグインを使用しています。
Line 21: Line 24:


[[Image:Save_picture.png|550px]]
[[Image:Save_picture.png|550px]]
</div>


[[Image:Save_picture.png|550px]]
[[Image:Save_picture.png|550px]]



===== 画像サイズ =====
===== 画像サイズ =====
Line 66: Line 69:
# アクティブなドキュメントを閉じます
# アクティブなドキュメントを閉じます
App.closeDocument(App.ActiveDocument.Name)
App.closeDocument(App.ActiveDocument.Name)
{{Code|code=
<syntaxhighlight>
Gui.ActiveDocument.ActiveView.saveImage('C:/temp/test.png',1656,783,'Current')
Gui.ActiveDocument.ActiveView.saveImage('C:/temp/test.png',1656,783,'Current')
}}
</syntaxhighlight>
This script makes a series of pictures of different sizes and from different
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.
points of view. The type of the camera, i.e. orthographic or perspective can also be changed.

<syntaxhighlight>
{{Code|code=
import Part,PartGui
import Part,PartGui
# loading test part
# loading test part
Part.open("C:/Documents and Settings/jriegel/My Documents/Projects/FreeCAD/data/Blade.stp")
Part.open("C:/Documents and Settings/jriegel/My Documents/Projects/FreeCAD/data/Blade.stp")
OutDir = 'c:/temp/'
OutDir = 'c:/temp/'
# creating images with different Views, Cameras and sizes
# creating images with different Views, Cameras and sizes
for p in ["PerspectiveCamera","OrthographicCamera"]:
for p in ["PerspectiveCamera","OrthographicCamera"]:
Gui.SendMsgToActiveView(p)
Gui.SendMsgToActiveView(p)
for f in ["ViewAxo","ViewFront","ViewTop"]:
for f in ["ViewAxo","ViewFront","ViewTop"]:
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.ActiveDocument.ActiveView.saveImage(OutDir + "Blade_" + p +"_" + f + "_" + `x` + "_" + `y` + ".jpg",x,y,"White")
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")
Gui.ActiveDocument.ActiveView.saveImage(OutDir + "Blade_" + p +"_" + f + "_" + `x` + "_" + `y` + ".png",x,y,"Transparent")

# close active document
# close active document
App.closeDocument(App.ActiveDocument.Name)
App.closeDocument(App.ActiveDocument.Name)
}}


{{Std Base}}
</syntaxhighlight>
{{Userdocnavi}}
{{clear}}
{{clear}}

Revision as of 20:23, 21 October 2019

Template:GuiCommand/jp

概要

このコマンドは現在の3Dビューの内容をファイルに保存するためのダイアログを開きます。 このダイアログでは様々な画像フォーマットで保存を行うことができます。 さらにパラメーターにアクセスするための"Options"ボタンを使ってスクリーンショットの アスペクト比や解像度を変更することも可能です。

またPNGやJPEGといった一部の画像フォーマットでは画像のコメントフィールドを使用して MIBA情報を画像に付加することも可能です。

画像フォーマット

FreeCADは画像保存のためにQTに組み込まれた画像タイプとbin/imageformatsディレクトリにある一部のQTプラグインを使用しています。 従って選択できるフォーマットの種類と数はあなたの使用しているプラットフォームに依存します。

ダイアログ

画像サイズ

画像サイズパラメーターはアクティブな3Dビューのスクリーンサイズに設定されますが任意の値に変更することができます。一部のOpenGLのドライバーでは8000ピクセルを超えたレンダリングができないことがあります。これは使用しているシステムによって変わります。

四つのボタンを使用してアスペクトを特定の値に変更することが可能です。

画像の背景

このコンボボックスを使用して作成する画像の背景を選択することが可能です。

  • Current (ユーザー設定で選択されている)現在のビューの背景を使用します
  • White 白一色の背景を作成します(例えば印刷時に使用します)
  • Black 黒一色の背景
  • Transparent 透過色をサポートしている画像フォーマットで透過背景を作成します
Comment

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

スクリプト処理

Pythonによってスクリーンを保存することもできます:

Gui.ActiveDocument.ActiveView.saveImage('C:/temp/test.png',1656,783,'Current')

このスクリプトは異なるサイズ、異なる始点で複数の画像を作成します。 カメラのタイプ、つまり正投影か透視投影かを変更することもできます。

import Part,PartGui
# テスト用パーツを読み込み
Part.open("C:/Documents and Settings/jriegel/My Documents/Projects/FreeCAD/data/Blade.stp")
OutDir = 'c:/temp/'

# 異なるビュー、カメラ、サイズで画像を作成
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")

# アクティブなドキュメントを閉じます
App.closeDocument(App.ActiveDocument.Name)
Gui.ActiveDocument.ActiveView.saveImage('C:/temp/test.png',1656,783,'Current')

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.

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 active document
App.closeDocument(App.ActiveDocument.Name)