CMeasurePoints:SetParams


The SetParams method changes the properties for points drawn on an image. Point properties are initialized to reasonable values by the class. The purpose of this method is to change the properties by setting values in the PointParams table. See the Mira User's Guide for more information under the main topic Measuring Images.

Syntax

bSuccess = CMeasurePoints:SetParams( PointParams_table)

bullet.gif    where PointParams_table is a table of type PointParams containing properties to change.

bullet.gif    On success, true is returned.

Example

Suppose an image window exists on the Mira screen and you wish to draw a point marker on the image. The script below changes the drawing color and line thickness from default values. Note that your table does not need to be named Params.

V = attachlist_imageview()

-- attach an image window

Assert( V, "No image window")

-- leave script if no image window

 

 

I = V:GetImage()

-- get the top-most or only image

Assert( I, "No image selected")

-- leave script if no image

 

 

P = new_measurepoints()

-- create a CMeasurePoints object

Params =

-- setup a PointParams table

{

-- use a comma after each "name=value" pair

  bSetColor = true,

-- enable new marker color

  sColor = "0,255,0",

 

  bSetLineThk = true,

-- enable new line thickness

  nLineThk = 2,

 

}

 

P:SetParams(Params)

-- set the new properties

 

 

bSuccess = P:Add( I, 300, 400 )

-- Add the measurement to the image

Related Topics

CMeasurePoints class, Add, PointParams table


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.