CLabels:SetParams
The SetParams method changes the properties for labels drawn on an image. Label properties are initialized to reasonable values by the class. The purpose of this method is to change the properties by setting values in the LabelParams table. See the Mira User's Guide for more information under the main topic Measuring Images.
bSuccess = CLabels:SetParams( LabelParams_table) |
where LabelParams_table is a table of type LabelParams containing properties to change.
On success, true is returned.
Suppose an image window exists on the Mira screen and you have a collection of object coordinates you wish to label on the image. The script below changes the marker size, drawing color, and line thickness from default values. Note that your table does not need to be named Params. Also, the values of x, y, and str do not need to be explicitly defined and could be included as parameters in the call to Add.
|
-- attach an image window |
|
-- leave script if no image window |
|
|
|
-- get the top-most or only image |
|
-- leave script if no image |
|
|
|
-- create a CLabels object |
|
-- setup a LabelParams table |
|
-- use a comma after each "name=value" pair |
|
-- enable new marker color |
|
|
|
-- enable new marker size |
|
|
|
-- enable new line thickness |
|
|
|
-- enable changing the centroid |
|
-- centroid the initial coordinates |
|
|
|
-- set the new properties |
-- x and y are the initial coordinates: |
|
|
-- coordinates and title |
|
-- Add a label to the image |
Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.