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.
C = CLabels:new()
C = CLabels:new( CImageView )
C = CLabels:new( CLabels2 ) |
If you use any constructor that does not use a CImageView object as an argument, then you must 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 fragment 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 fragment 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 |