TechDraw Image: Difference between revisions

From FreeCAD Documentation
No edit summary
(Marked this version for translation)
Line 11: Line 11:
==Description== <!--T:2-->
==Description== <!--T:2-->


<!--T:8-->
The Image tool inserts a [[bitmap]] image (PNG, TIFF, JPEG, etc.) from a file into the page as a view.
The Image tool inserts a [[bitmap]] image (PNG, TIFF, JPEG, etc.) from a file into the page as a view.


Line 16: Line 17:
[[Image:TechDraw_Image_example.png]]
[[Image:TechDraw_Image_example.png]]
<translate>
<translate>
<!--T:9-->
{{Caption|Image inserted in the drawing page}}
{{Caption|Image inserted in the drawing page}}


==How to use== <!--T:3-->
==How to use== <!--T:3-->


<!--T:10-->
# Press the {{Button|[[Image:Techdraw-image.svg|16px]] [[TechDraw Image|Image]]}} button
# Press the {{Button|[[Image:Techdraw-image.svg|16px]] [[TechDraw Image|Image]]}} button
# A file dialog will open. Select a location and file name.
# A file dialog will open. Select a location and file name.
Line 25: Line 28:
==Properties== <!--T:5-->
==Properties== <!--T:5-->


<!--T:11-->
* Use the Scale property to adjust the size of the image.
* Use the Scale property to adjust the size of the image.
* Use the Width and Height properties to clip the image.
* Use the Width and Height properties to clip the image.
Line 30: Line 34:
==Scripting== <!--T:6-->
==Scripting== <!--T:6-->


<!--T:12-->
{{Emphasis|See also:}} [[TechDraw API]] and [[FreeCAD Scripting Basics]].
{{Emphasis|See also:}} [[TechDraw API]] and [[FreeCAD Scripting Basics]].


<!--T:13-->
The Image tool can be used in [[macros]] and from the [[Python]] console by using the following functions:
The Image tool can be used in [[macros]] and from the [[Python]] console by using the following functions:


Line 45: Line 51:
<translate>
<translate>


<!--T:14-->
{{TechDraw Tools navi}}
{{TechDraw Tools navi}}


<!--T:15-->
{{Userdocnavi}}
{{Userdocnavi}}
</translate>
</translate>

Revision as of 20:24, 3 January 2019

TechDraw Image

Menu location
TechDraw → Image
Workbenches
TechDraw
Default shortcut
None
Introduced in version
-
See also
TechDraw Symbol

Description

The Image tool inserts a bitmap image (PNG, TIFF, JPEG, etc.) from a file into the page as a view.

Image inserted in the drawing page

How to use

  1. Press the File:Techdraw-image.svg Image button
  2. A file dialog will open. Select a location and file name.

Properties

  • Use the Scale property to adjust the size of the image.
  • Use the Width and Height properties to clip the image.

Scripting

See also: TechDraw API and FreeCAD Scripting Basics.

The Image tool can be used in macros and from the Python console by using the following functions:

dvi = FreeCAD.ActiveDocument.addObject('TechDraw::DrawViewImage','TestImage')
rc = page.addView(dvi)
dvi.ImageFile = "pathToMy/imageFile.png"
dvi.Height = 200
dvi.Width  = 200