TechDraw Image: Difference between revisions

From FreeCAD Documentation
(relink module to workbench)
(Properties)
Line 39: Line 39:
==Properties== <!--T:5-->
==Properties== <!--T:5-->


=== Data ===
<!--T:11-->

* Use the Scale property to adjust the size of the image.
{{TitleProperty|Base}}
* Use the Width and Height properties to clip the image.

See [[TechDraw_View#Properties|TechDraw View]]

{{TitleProperty|Image}}

* {{PropertyData|Image File|File}}: The file containing this bitmap.
* {{PropertyData|Image Included|FileIncluded}}: Embedded image file. System use only.
* {{PropertyData|Width|Float}}: The width of the cropped image in mm. Only used if {{PropertyView|Crop}} is {{TRUE}}.
* {{PropertyData|Height|Float}}: The height of the cropped image in mm. Idem.

=== View ===

{{TitleProperty|Base}}

See [[TechDraw_View#Properties|TechDraw View]]

{{TitleProperty|Image}}

* {{PropertyView|Crop|Bool}}: Crop the image to {{PropertyData|Width}} x {{PropertyData|Height}}.


==Scripting== <!--T:6-->
==Scripting== <!--T:6-->

Revision as of 14:19, 10 September 2022

TechDraw Image

Menu location
TechDraw → Insert Bitmap Image
Workbenches
TechDraw
Default shortcut
None
Introduced in version
-
See also
TechDraw SVG 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

Usage

  1. Press the Insert Bitmap Image button
  2. A file dialog will open. Select a location and file name.

Properties

Data

Base

See TechDraw View

Image

  • DataImage File (File): The file containing this bitmap.
  • DataImage Included (FileIncluded): Embedded image file. System use only.
  • DataWidth (Float): The width of the cropped image in mm. Only used if ViewCrop is true.
  • DataHeight (Float): The height of the cropped image in mm. Idem.

View

Base

See TechDraw View

Image

  • ViewCrop (Bool): Crop the image to DataWidth x DataHeight.

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