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.
bSuccess = CMeasureRegions:SetParams( RegionParams_table) |
where RegionParams_table is a table of type RegionParams containing properties to change.
On success, true is returned.
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.
|
-- attach an image window |
|
-- leave script if no image window |
|
|
|
-- get the top-most or only image |
|
-- leave script if no image |
|
|
|
-- create a CMeasureRegions object |
|
-- setup a RegionParams table |
|
-- use a comma after each "name=value" pair |
|
-- enable new marker color |
|
|
|
-- enable new line thickness |
|
|
|
-- enable drawing a filled region |
|
|
|
|
|
-- set the new properties |
|
|
|
-- create a table for x and y coordinates |
|
-- x1 |
|
-- y1 |
|
-- x2 |
|
-- y2 |
|
-- etc. |
|
|
|
|
|
|
|
|
|
-- Add the measurement to the image |
CMeasureRegions class, Add, RegionParams table
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2024 Mirametrics,
Inc. All Rights Reserved.