|
CMeasureRegions:SetParams
The SetParams method changes the properties
for regions drawn on an image. Region properties are initialized to
reasonable values by the class. The purpose of this method is to
change the properties by setting values in the
RegionParams table. See the Mira User's Guide
for more information under the main topic Measuring
Images.
Syntax
|
bSuccess = CMeasureRegions:SetParams(
RegionParams_table)
|
where
RegionParams_table is a table of type
RegionParams containing properties to change.
On success,
true is returned.
Example
Suppose an image window exists on the Mira screen
and you wish to draw a region on the image. The script below
changes several drawing properties from default values. Note that
your table does not need to be named Params.
|
V = attachlist_imageview()
|
|
|
Assert( V, "No image window")
|
|
|
|
|
|
I = V:GetImage()
|
|
|
Assert( I, "No image
selected")
|
|
|
|
|
|
R = new_measureregions()
|
|
|
Params =
|
|
|
{
|
|
|
bSetColor = true,
|
|
|
sColor =
"0,255,0",
|
|
|
bSetLineThk =
true,
|
|
|
nLineThk = 2,
|
|
|
bSetFilled =
true,
|
|
|
bFilled = true
|
|
|
}
|
|
|
R:SetParams(Params)
|
|
|
|
|
|
tblData = {}
|
|
|
tblData[1] = xc - 200
|
|
|
tblData[2] = yc + 50
|
|
|
tblData[3] = xc + 150
|
|
|
tblData[4] = yc + 220
|
|
|
tblData[5] = xc + 280
|
|
|
tblData[6] = yc - 100
|
|
|
tblData[7] = xc - 100
|
|
|
tblData[8] = yc - 80
|
|
|
|
|
|
bSuccess = R:Add( I, tblData
)
|
|
Related Topics
CMeasureRegions class
Add
RegionParams table
Mira Pro x64 Script User's Guide, v.8.76 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.
|