In TestComplete, there are several components and processing images such as testing log, region checkpoints, and Visualizer. In all the cases, TestComplete uses a specific image format for storing pictures.
In this recipe we will learn the ropes concerning the alteration of these images' format, which TestComplete is processing.
In order to change pictures' format we need to perform the following steps:
Here in the Images group, the currently used format is displayed (for example, PNG).
TestComplete supports four image formats, each of them having certain advantages and shortcomings as follows:
For the vast majority of cases, the variant with the PNG format is of a greater avail than others.
If, in majority of the cases, you are better off with one of the economizing formats (PNG or JPEG), and it is seldom you need to create precise images in the BMP format, you can still change the format of the images on the fly.
The following example demonstrates creation of a screenshot with the use of the following two differing formats:
function testPirtureFormat() { Options.Images.ImageFormat = "BMP"; Log.Picture(Sys.Desktop.Picture(), "BMP screenshot"); Options.Images.ImageFormat = "PNG"; Log.Picture(Sys.Desktop.Picture(), "PNG screenshot"); }