LabelParams Table


The LabelParams table contains properties used by the CLabels class. This table is used to change properties using the class SetParams method.

The table below lists the point measurement properties and their update status. For each property in the top half of the table, there exists a corresponding update status flag in the lower half of the table. The name of the update status flag prefixes the property name with the word Set. For example, the property bCentroid has the update status flag bSetCentroid. Normally, the update status flag is set to false. But to change it using the LabelParams table, you must the the status flag to true. Create a LabelParams table containing only the properties you wish to change. Then call the class SetParams method with the LabelParams table as its parameter.

Table Member

Default

Definition

Property:

 

 

sColor

"255,0,0"

The color of the point. See the nRasterOp property.

nRasterOp

13

Controls the way the marker color and image color are combined for drawing. The default draw markers with a solid line of color sColor.

nMarkerSize

33

Sets the length and width of the crosshair marker, in pixels.

nLineThk

1

Sets the thickness of the marker line, in pixels, drawn on the image.

nMatchingTol

3

Sets the tolerance, in pixels, for mouse click "hits" to the point.

nMarkerType

2

Sets the marker type.

nAlign

6

Sets the alignment between the marker center and the text label.

bUseDockingPane

false

Specifies whether to list point measurements in a docking pane (true) instead of a measurement window (false).

Update Status:

 

 

bSetColor

false

Enables changes to sColor.

bSetRasterOp

false

Enables changes to nRasterOp.

bSetMarkerSize

false

Enables changes to nMarkerSize.

bSetLineThk

false

Enables changes to nLineThk.

bSetMatchingTol

false

Enables changes to nMatchingTol.

bSetMarkerType

false

Enables changes to nMarkerType.

bSetAlign

false

Enables changes to nAlign.

bSetUseDockingPane

false

Enables changes to bUseDockingPane.

Example

Suppose an image window exists on the Mira screen and you have a collection of object coordinates you wish to mark on the image. The script below sets the marker size, drawing color, and line thickness before drawing the label.

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_labels()

-- create a CLabels object

Params =

-- setup an LabelParams table

{

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

  bSetColor = true,

-- enable new marker color

  sColor = "0,255,0",

 

  bSetMarkerSize = true,

-- enable new marker size

  nMarkerSize = 65,

 

  bSetLineThk = true,

-- enable new line thickness

  nLineThk = 2,

 

}

 

L:SetParams(Params)

-- set the new properties

 

 

x = 300; y = 7500; str = "my label"

-- coordinates and title of the label

L:Add(I, x, y, str)

-- Add a label to the image

Related Topics

CLabels class, SetParams


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