Images
Images can be included in the comment with the image
directive.
Description | The directive markup consists of an explicit markup start (".. ") followed by the type of the directive ( (See also: Directives) |
Principle |
|
Properties |
|
Options
Optionally, the directive block can contain a flat field list with image options. The following options are recognized:
height: length | Height of the image. Used to scale the image vertically. The width of the image is adjusted proportionally if possible.
|
width: length or percentage of the current line width | Width of the image. Used to scale the image horizontally. The height of the image is adjusted proportionally if possible.
|
align: „left“ or „right“ | Alignment of the image. The values "left" and "right" control the horizontal alignment of an image so that the image can float and the text can flow around it. |
target: text (URI or reference name) | Turns the image into a reference ("clickable"). The argument of the option can be a URI (relative or absolute) or a reference name with an underscore suffix (e.g. name_). |
scale: integer percentage | Uniform scaling factor of the image. Used to scale the image proportionally.
|
If an image is included without a height or width option, the width of the displayed image corresponds to the window width of the Library Manager. The height of the image is adjusted proportionally to the image width. The image is displayed as large as possible. The proportionality of the image is maintained.
Absolute or relative file path as directive argument
You can specify both absolute and relative file paths in the argument of the image directive in order to reference images.
Specify an absolute file path if you have saved the image in an arbitrary folder in your file system. Specify a relative path if the image is integrated in the library project.
Forwarding the library file If you integrate the images in the library project and use relative file paths and then forward the library project as a file, the required image information will be sent with it directly as part of the library project. If you use absolute file paths, the images must be forwarded separately and must exist at the place in the file system specified in the file path for the person who uses the library. The latter is also a static approach in which the organization and maintenance of the image information in the file system means additional work. |
Absolute file path | e.g. C:\Tc3LibDocImages\SamplePicAbsolute.jpg |
Relative file path Requirement: TwinCAT 3.1.4022.22
| e.g. ../../LibPics/SamplePicRelative.jpg Integrating an image in the PLC project
Solution Explorer: Library Manager: |
Samples
(In sample project: B_DocuElements\Images\FB_Libdoc_Images)
Absolute or relative file path as directive argument
(*
Absolute path
.. image:: C:\Tc3LibDocImages\SamplePicAbsolute.jpg
:width: 70px
Relative path
.. image:: ../../LibPics/SamplePicRelative.jpg
:width: 70px
*)
Left aligned image
(*
.. image:: C:\Tc3LibDocImages\SampleLib1\img11.jpg
:width: 20%
Description of the function block. Description of the function block. Description of the function block.
Description of the function block. Description of the function block. Description of the function block.
Description of the function block. Description of the function block. Description of the function block.
Description of the function block. Description of the function block. Description of the function block.
*)
Floating image, left aligned
(*
.. image:: C:\Tc3LibDocImages\SampleLib1\img11.jpg
:width: 20%
:align: left
Description of the function block. Description of the function block. Description of the function block.
Description of the function block. Description of the function block. Description of the function block.
Description of the function block. Description of the function block. Description of the function block.
Description of the function block. Description of the function block. Description of the function block.
*)
Floating image, right aligned
(*
.. image:: C:\Tc3LibDocImages\SampleLib1\img11.jpg
:width: 20%
:align: right
Description of the function block. Description of the function block. Description of the function block.
Description of the function block. Description of the function block. Description of the function block.
Description of the function block. Description of the function block. Description of the function block.
Description of the function block. Description of the function block. Description of the function block.
*)
Inline images can be defined with an image
directive in a substitution definition (see Substitution).