The QTPlgCompressImage provides QTPlugin developers with services to manage the compression of still images. This class uses the standard image–compression dialog component to control the process of compressing an image. Because the standard image–compression dialog is a component, the class uses the Component Manager to open and close a connection to the component; QTPlugin developers do not worry about it, cause the QTPlgCompressImage takes care about the details of opening and closing a connection to the standard image–compression dialog component.
You can use the class to obtain image compression parameters from the user (or set them by yourself) and to manage the process of compressing the image. You can follow several ways to control the different steps involved into the compression process.
The simplest way is to use the standard image–compression dialog component dialog box. The dialog box presents a consistent interface to the user; the QTPlgCompressImage eliminates the need for you to worry about the details of managing this dialog box. Also, provided that the requirements are met, this class features the class method as well. Once you have collected the parameter information from the user, you can use the class to instruct the Image Compression Manager to perform the image compression. Again, the class manages the details for you.
Alternatively, you can use the methods the class provides you with to examine or modify the parameters to be used during the compression process. This way allows you to perform the process of compressing the image without using any user interface.
Whatever way you follow, the class allows you to store the compression parameters you have set into files and restore them later.
→ →
The QTPlgCompressImage class constructors are called when you create a new instance of the class, while
the ˜QTPlgCompressImage class destructor, is called automatically when the
class is no more in use. Also, you can invoke the class destructor by setting the instance of the class to nil.
Once a new class instance is returned, it is good practice to check the class property to be sure that the new object can be used. See the validity requirements for more details.
The class provides you with the following initializer methods:
()
This is the default constructor. The new class instance will try to open a connection
to the standard image–compression dialog component; if the connection succeeds, the properties of the class will
be initialized to the default settings of the
the standard image–compression dialog component
(other as QTPlgCompressImage)
This is the copy constructor. The new class instance will try to open a connection
to the standard image–compression dialog component; if the connection succeeds, the properties of the object to be copied
will be used to initialize the new class instance properties
(fSettings as folderitem)
The new class instance will try to open a connection
to the standard image–compression dialog component; if the connection succeeds, you can use this version of the class constructor to
initialize the properties of the class with the settings
in the file
specified by the fSettings
specifies the settings that will be applied to the compression process. If you want to compress the entire source image, you should
let the and
properties set to
0 and the property
to an empty rectangle
if you specify either a valid region of interest (the
property) or
a scale (by using the
and
properties) or both,
the class will apply them during the compression using the
following order: first will be used the roi to delimit the original image area to compress, then the resulting image will be
scaled as appropriate
[Deprecated]: since version 6.6 of the plugin this property is deprecated
and will be removed from a future plugin version; use the
class property instead
(src as folderitem, dst as folderitem)
use this method to compress the image file specified by the src parameter and save it as picture file to the
destination specified by the dst . The source image file format must be one of those supported by the QuickTime’s
graphics importer component
(p as picture, dst as folderitem)
use this method to compress the image specified by the p parameter and save it as picture file to the
destination specified by the dst
(m as ,
tm as integer, dst as folderitem)
use this method to compress the frame of the movie specified by the m parameter and save it as picture file to the
destination specified by the dst . The tm parameter indicates the time of interest within the movie
and must be expressed in movie’s time scale
(p as picture, byref buffer as memoryblock,
byref imageSettings as
)
use this method to compress the picture specified by the p parameter and manage the results of the compression by
yourself. On success, the method will allocate a buffer in memory of appropriate size and will store the compressed data
there; you can inspect the properties of the imageSettings object to find about the parameters of these compressed
data. Also you can obtain the size of the returned memoryblock by using wether its size property or the
property of the
imageSettings object