CLabels:new
The new method constructs a new instance of a CLabels object. The CLabels class includes properties that control calculation of centroid positions. Various constructor overloads are available to create a new CLabels and initialize the properties.
Use the default constructor to creates a default CLabels object with properties initialized to default values. You will need to attach this to a CImageView object: C = CLabels:new() C = CLabels:new( CLabels2 ) C = CLabels:new( CImageView ) where |
CLabels2 is an existing CLabels object whose properties will be copied to the new CLabels object.
CImageView is an existing CImageView object containing a CImage that will be attached to the new CLabels object.
If no arguments are passed, the default constructor creates a default CLabels object.
C is the new CLables object.
If you use a constructor that does not pass a CImageView object, then you must later specify one using Attach method before labels can be drawn on an image.
Suppose a CImageView V exists and displays 1 or more images. The following script illustrates two forms of the new constructor. Both produce the same result:
|
-- create a new CLabels L attached to V |
|
-- target coordinates |
|
-- label coordinates |
|
-- I is the current displayed image in V |
|
-- draw the label on the image |
The following script does the same thing but uses the 2-step attachment to a CImageView:
|
-- create a new CLabels L |
|
-- target coordinates |
|
-- label coordinates |
|
-- attach to the CImageView V |
|
-- I is the current displayed image in V |
|
-- draw the label on the image |