new_measurepoints


The new_measurepoints function is a non-class version of the CMeasurePoints:new method which creates and returns a new CMeasurePoints object. You must create the object before using any class methods or properties.

Syntax

C = new_measurepoints()

bullet.gif    Creates a default CMeasurePoints object with properties initialized to default values.

C = new_measurepoints( Params )

bullet.gif    Creates a CMeasurePoints object with default properties updated to values in the PointParams Table, Params.

C = new_measurepoints( CMeasurePoints_old )

bullet.gif    This is a copy constructor. It creates a new CMeasurePoints object initialized to the members of theCMeasurePoints_old argument.

Example

The following script creates a new CMeasurePoints object, attaches an image window and an image, then draws an angle on the image after moving adjusting the passed coordinates to the nearby centroid position.

P = new_measurepoints()

-- create a new CMeasurePoints

 

 

Params =

 -- PointParams properties to change

{

  

  bSetColor = true,

 

  sColor = "0,255,0",

 

  bSetPointThk = true,

 

  nPointThk = 1.5,

 

  bSetCentroid = true,

 

  bCentroid = true,

 

}

  

P:SetParams(Params)

  

 

 

V = attachlist_imageview()

-- connect to an image window

Assert( V, "No image window")

 -- exit if no image window

-- grab an image from the window, V

 

--DO NOT declare I as "local" inside the block

 

if V:Count() > 1 then

  

  I = CImage:AttachFromList( V )

-- pick the image from the CImageView V

  Assert( I, "No Images available")

 -- exit if no image

else

 

  I = V:GetImage()

-- pick the only image in the window

end

 

x = 300; y = 205

-- coordinates of point 1

bSuccess = L:Add(I, x, y)

-- Add the point and draw it on the image

Related Topics

CMeasurePoints class, new, delete, PointParams Table

 


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