|
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.
Syntax
|
bSuccess = CLabels:SetParams(
LabelParams_table)
|
where
LabelParams_table is a table of type
LabelParams containing properties to change.
On success,
true is returned.
Example
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.
|
V = attachlist_imageview()
|
|
|
Assert( V, "No image window")
|
|
|
|
|
|
I = V:GetImage()
|
|
|
Assert( I, "No image
selected")
|
|
|
|
|
|
L = new_labels()
|
|
|
Params =
|
|
|
{
|
|
|
bSetColor = true,
|
|
|
sColor =
"0,255,0",
|
|
|
bSetMarkerSize =
true,
|
|
|
nMarkerSize = 65,
|
|
|
bSetLineThk =
true,
|
|
|
nLineThk = 2,
|
|
|
bSetCentroid =
true,
|
|
|
bCentroid = true,
|
|
|
}
|
|
|
L:SetParams(Params)
|
|
|
|
|
|
x = 300; y = 7500; str = "my
label"
|
|
|
L:Add(I, x, y, str)
|
|
Related Topics
CLabels class
Add
LabelParams table
Mira Pro x64 Script User's Guide, v.8.76 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.
|