PrintToBmp - method of the PmaPanel object

Saving the panel or its part into the file *.bmp, *.png, *.jpg, *.gif or *.tif.
This method is obsolete (but functional). See PmaPanel.Print, PmgRoot.Print.
Boolean PrintToBmp(String sFile, [String sOptions], [String sParams])
sFile(String) The file name with the path (*.bmp, *.png, *.jpg, *.gif or *.tif). The file extension specifies the graphic format.
If a full path is not entered, then it is completed relative to the application folder.
It is recommended to use the PROMOTIC path syntax - see PROMOTIC path to files and folders.
sOptions[optional](String) Additional parameters that define the way of printing (cutout, etc.).
If not set, then the whole panel is printed with default settting.
Entries are in the KeyVal format, for example "x:0;y:0;dx:300;dy:200;".
"x:nnn;" (optional) - x-position of the left upper corner of the cutout (in pixels, default 0).
"y:nnn;" (optional) - y-position of the left upper corner of the cutout (in pixels, default 0).
"dx:nnn;" (optional) - The size of the x-cutout (default: the whole panel) (in pixels).
"dy:nnn;" (optional) - The size of the y-cutout (default: the whole panel) (in pixels).
sParams[optional](String) It allows to set the value of parameters of the PmgRoot object.
This parameter is then accessible in the panel configurators by means of the Macro expression $.par and in the script by the GetPar method.
Each parameter here consists of an identifier (name) and a value.
Syntax: "pars:{name1:value1;name2:value2; ...}".
See also: Parameters of the Pmg object.
Return values:
true - If the panel has been saved successully
false - Otherwise
If this method is called over the panel that is not open then the panel is opened invisibly and then it is closed after printing is finished. During this process the onOpen and onClose events are not activated.
Caution! The window Pmg objects may be displayed incorrectly (e.g. the PmgVideo object 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.

This method is not functional in Web panels.
Saving the whole panel into the test.bmp file:
Saving the whole panel into the test.bmp file:
VBScriptSelect and copy to clipboard

Dim b
b = pMe.Pm("/panel").PrintToBmp("#appres:test.bmp")
Saving the cutout of the panel into the test.png file, where the cutout begins on the position 100,100 and its size is 300,200:
VBScriptSelect and copy to clipboard

Dim b
b = pMe.Pm("/panel").PrintToBmp("#appres:test.png", "x:100;y:100;dx:300;dy:200;")
PROMOTIC 9.0.21 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.