Contents
Navigation
Home User Reference Other Resources

The QTPlgGraphicsContext class provides a convenient, general purpose, container to deal with parameters that define a series of graphics transformation to apply to some visual data; using instances of this class allows to implement a simple and unique interface to provide and/or retrieve parameters that affect how data will be displayed or drawed somewhere by other plugin classes.

Since version 6.7 of the plugin this class can be used in Console Applications






The QTPlgGraphicsContext class constructors are called when you create a new instance of the class, while the ˜QTPlgGraphicsContext 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. A QTPlgGraphicsContext object is always valid.

The class implements the following initializer methods:
()
This is the default constructor. All of the class properties are initialized in such a way to define no tranformation at all.
(other as QTPlgGraphicsContext)
This is the copy constructor. The properties of the object to be copied will be used to initialize the new class instance properties
(srcRect as , dstRect as )
use this constructor version to define a region of interest to apply to the source of visual data (the srcRect) and a destination area (the dstRect) in which the visual data will be displayed after any specified transformation has been applied to them. You can modify both these rectangles anytime by using the appropriate

identifies the source rectangle
identifies the destination rectangle
specifies a mask region to apply to the resulting image
determines if the resulting image will be inverted
specifies if any color information has to be discarded from the resulting image
specifies if the resulting image must be flipped horizontally
specifies if the resulting image must be flipped vertically
specifies the graphics mode to associate with the current drawing operation; you can use one of the defined by the plugin
[Deprecated]: since version 6.5 of the plugin this property is deprecated and will be removed from a future plugin version; use the class property instead
specifies the color for use in blending and transparent operations
[Deprecated]: since version 6.5 of the plugin this property is deprecated and will be removed from a future plugin version; use the class property instead
specifies the color for use in blending and transparent operations and the graphics mode to associate with the current drawing operation
determines the amount of rotation, expresses as degrees, to apply to the resulting image; a value of means no rotation. The anchor point of the rotation will be always the center of the
specifies the amount of horizontal translation, expresses in pixels, to apply to the resulting image; a value of 0 means no horizontal translation. The anchor point of the translation will be always the center of the
specifies the amount of vertical translation, expresses in pixels, to apply to the resulting image; a value of 0 means no vertical translation. The anchor point of the translation will be always the center of the
determines the scale to apply to the images before being displayed; a value of 1.0 means no zoom. The anchor point of the zoom will be always the center of the
returns the matrix resulting from the application of the graphical transformations specified by the following class properties (displayed in order of application):
  • scaling and translating from to
  • flipping along x () and y ()
  • scaling according to
  • translating according to and
  • rotating according to
The matrix is the center of the
determines the amount of gamma correction that will be applied to the data before displaying them; a value of 1.0 causes no gamma correction to be applied.

()
use this method to ensure that the coincides with the ; any previously defined clipping region will be discarded
returns nothing. Check the class property for errors
(gc as QTPlgGraphicsContext)
this function allows you to assign the values of the properties of the object specified by the gc parameter to the current graphics context; before copying, the properties of the class will be re–initialized to their default values
returns nothing. Check the class property for errors
()
using this function clears at one go all of the changes previously done, restoring the default values of the class properties
returns nothing. Check the class property for errors

() as
this operator allows you to use a QTPlgGraphicsContext object whenever the QTPlugin requires the usage of a object
returns a class instance


[Removed]: since version 6.5 of the plugin these constants have been removed; use the of the plugin module instead