CMeasureLines:SetParams


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

Syntax

bSuccess = CMeasureLines:SetParams( LineParams_table)

bullet.gif    where LineParams_table is a table of type LineParams 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 line 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. Also, the coordinates do not need to be explicitly defined and could be included as parameters in the call to Add.

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

 

 

L = new_measurelines()

-- create a CMeasureLines object

Params =

-- setup a LineParams 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,

 

}

 

L:SetParams(Params)

-- set the new properties

 

 

x1 = 300; y1 = 205

-- coordinates of endpoint 1

x2 = 100; y2 = 530

-- coordinates of endpoint 2

bSuccess = L:Add( I, x1, y1, x2, y2 )

-- Add the measurement to the image

Related Topics

CMeasureLines class, Add, LineParams table


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