Skip to content

BITMAPINFO ​

Retrieve size information of a metafile ("vector") graphic / image.

Syntax ​

leo-grammar
METAFILEINFO strValue .

Parameters ​

  • <main-parameter> (strValue) - The path to a file, either local, in the database or accessible via HTTP/S.

Returns ​

  • bmpwidth (intValue) - The width of the image file in pixels.
  • bmpheight (intValue) - The height of the image file in pixels.

Details ​

This command sets two variables bmpwidth and bmpheight with the width and the height of the image in pixels. These can be used for the definition of the rectangle in which the image will be represented while keeping the size or at least the aspect ratio intact.

The image data can either be loaded from a file or provided directly. The most common approach is to load the image data from a file by providing the file 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 \ as \\ in c:\bitmaps\logo.bpm leading to "c:\\bitmaps\\logo.bmp". If loading the file is not possible, the graphical representation will be shown as if no file was specified.

The image data can be 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 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 Metafile
  • wmf: 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.

See Also ​

Examples ​

Draw the image from a local file located at c:\temp\adoxx_logo.wmf scaled down but keeping the aspect ratio.
The ADOxx logo

leo
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