METAFILE ​
Draws a metafile ("vector") graphic / image.
Syntax ​
METAFILE strValue [ x:measureValue ] [ y:measureValue ] [ w:measureValue ] [ h:measureValue ] .
Parameters ​
<main-parameter>
(strValue) - The path to a file, either local, in the database or accessible via HTTP/S.x
(measureValue, optional) - The x-coordinate of the top-left corner for the image. The default is0cm
.y
(measureValue, optional) - The y-coordinate of the top-left corner for the image. The default is0cm
.w
(measureValue, optional) - The width for the image. The default is0cm
.h
(measureValue, optional) - The height for the image. The default is0cm
.
Details ​
This command is not influenced by any style commands.
The image is drawn as a rectangle with the top left corner at x
and y
coordinates and the specified width w
and height h
. It will be resized to fit into the rectangle and possibly distort the image if the original aspect ratio is different. Use the command METAFILEINFO to determine an image's original size.
The image data is loaded from a file by providing its path via the <main-parameter>
. The path can lead either to the local file system, the database (paths starting with "db:\\"
) or a resource on the internet accessible via HTTP/S (paths that start with "http://"
or "https://"
). As the path is provided as a string it is necessary to escape various characters, for example \
escaped as \\
in a path like c:\metafiles\logo.emf
leading to "c:\\metafiles\\logo.emf"
. If loading the file is not possible, the graphical representation will be shown as if no file was specified.
The following file formats are supported:
emf
: Windows Enhanced Metafilewmf
: Windows Metafile
The file extension is irrelevant, but the data of the image has to be according to one of those formats.
When loading the image data from a file, then the data is cached internally based on the path. Changes to the image file are not reflected until it is removed from the cache. The file is removed from the cache when all models where the file is used are closed.
Rotation of an image is not possible. This has an influence on the drawing of relations where a rectangular shape will change with different rotations.
See Also ​
Examples ​
Draw the image from a local file located at c:\temp\adoxx_logo.wmf
scaled down but keeping the aspect ratio.
GRAPHREP
METAFILEINFO ("c:\\temp\\adoxx_logo.wmf")
METAFILE ("c:\\temp\\adoxx_logo.wmf") w:(CM bmpwidth / 72) h:(CM bmpheight / 72)
Versions and Changes ​
Available since ADOxx 1.3