CMeasureAngles Class Description CMeasureAngles:Add

new_measureangles


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

Syntax

C = new_measureangles()

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

C = new_measureangles( Params )

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

C = new_measureangles( CMeasureAngles_old )

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

Example

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

A = new_measureangles()

-- create a new CMeasureAngles

 

 

Params =

 -- AngleParams properties to change

{

  

  bSetColor = true,

 

  sColor = "0,255,0",

 

  bSetLineThk = true,

 

  nLineThk = 1.5,

 

  bSetCentroid = true,

 

  bCentroid = true,

 

}

  

A: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

 

xv = 400; yv = 60

-- coordinates of the vertex

x1 = 300; y1 = 205

-- coordinates of endpoint 1

x2 = 100; y2 = 530

-- coordinates of endpoint 2

bSuccess = A:Add(I, xv, yv, x1, y1, x2, y2)

-- Add the angle and draw it on the image

Related Topics

CMeasureAngles class

new

delete

AngleParams Table

 

 

 


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