Promotic
WikipediaLinkedInYoutubeTwitterFacebook

PrintToBmp - method of object PmPanel

Description:
Saving the panel or its part into file *.bmp, *.png, *.jpg, *.gif or *.tif.

This method is obsolete (but functional). See PmPanel.Print, PmiRoot.Print.

Syntax:
PrintToBmp(sFile As String, [sOptions As String], [sParams As String]) As Boolean
Calling:
b = oPanel.PrintToBmp(sFile, sOptions)
Parameters:
sFile(String) Name of the file (*.bmp, *.png, *.jpg, *.gif or *.tif) with the path. The file extension determines the graphic format. If a full path is not entered, it is completed relatively according to the application file folder.

It is recommended to use the PROMOTIC path syntax - see PROMOTIC path to files and folders.

sOptions[optional] (String) Text list of parameters that define the way of printing (cutout, etc.). If not stated, the whole panel is printed with default settings. Entries with assigned value are separated by a semicolon, for example "x:0;y:0;dx:300;dy:200;".
"x:nnn;" (optional) - x-position of the left upper point of the cutout (in pixels, default 0).
"y:nnn;" (optional) - y-position of the left upper point of the cutout (in pixels, default 0).
"dx:nnn;" (optional) - x-size of the cutout (the whole panel by default) (in pixels).
"dy:nnn;" (optional) - y-size of the cutout (the whole panel by default) (in pixels).
sParams[optional] (String) Allows to set the value of parameters of PmiRoot graphic item. This parameter is then accessible in the panel configurators by the Macro expression $.par and from the script by the GetPar method. Each parameter consists of an identifier (name) and a value. Syntax: "par:name1=value1;par:name2=value2; ...". See also: Parameters of graphic item. Text list of parameters that define the way of printing (cutout, etc.). If not stated, the whole panel is printed with default settings. See sParams default value.
Return Values:
true - if the panel has been saved successully.
false - otherwise
Note:
If the method is called over the panel that is not opened, the panel is opened invisibly and it is closed after printing. Whilst the onOpen and onClose events are not fired.

Caution! The window graphic items may be displayed incorrectly (e.g. the PmiWAnimate element in the Multimedia) playback mode, because the necessary data sometimes cannot be read/created fast enough.

Three basic graphic formats description:

*.bmp - no data compression, largest files of all formats.
*.png - lossless compression, original image quality, much smaller files (recommended format).
*.jpg - lossy compression, the image quality is lower but the file size is the smallest of all formats.
Example1:
Saving the whole panel into the file test.bmp:
oPanel.PrintToBmp "#appres:test.bmp"
Example2:
Saving the cutout of the panel into the file test.png where the cutout begins on the position 100,100 and its size is 300,200:
oPanel.PrintToBmp "#appres:test.png", "x:100;y:100;dx:300;dy:200;"
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice