BioGTK  6.5.0
A .NET library & program for annotating, editing various microscopy imaging formats using Bioformats supported images. Including whole slide, pyramidal, and series.
Loading...
Searching...
No Matches
BioGTK.Tools.Tool Class Reference

Public Types

enum  ToolType { color , annotation , select , function }
 
enum  Type {
  pan , move , point , line ,
  rect , ellipse , polygon , text ,
  delete , freeform , magic , brush ,
  bucket , eraser , dropper , switchColors ,
  color1 , color2 , script
}
 

Public Member Functions

 Tool (Type t)
 
 Tool (Type t, ColorS col)
 
 Tool (Type t, RectangleD r)
 
 Tool (Type t, string sc)
 
override string ToString ()
 

Static Public Member Functions

static void Init ()
 It adds all the tools to the tools list.
 

Public Attributes

List< AForge.Point > Points
 
ToolType toolType
 
bool selected
 
Pixbuf image
 
Rectangle bounds
 
string script
 
Type type
 
ColorS tolerance
 
ColorS color
 

Properties

RectangleD Rectangle [get, set]
 
RectangleF RectangleF [get]
 

Detailed Description

Definition at line 1562 of file Tools.cs.

Member Enumeration Documentation

◆ ToolType

enum BioGTK.Tools.Tool.ToolType

Definition at line 1567 of file Tools.cs.

1568 {
1569 color,
1570 annotation,
1571 select,
1572 function
1573 }

◆ Type

enum BioGTK.Tools.Tool.Type

Definition at line 1574 of file Tools.cs.

1575 {
1576 pan,
1577 move,
1578 point,
1579 line,
1580 rect,
1581 ellipse,
1582 polygon,
1583 text,
1584 delete,
1585 freeform,
1586 magic,
1587 brush,
1588 bucket,
1589 eraser,
1590 dropper,
1591 switchColors,
1592 color1,
1593 color2,
1594 script,
1595 }

Constructor & Destructor Documentation

◆ Tool() [1/5]

BioGTK.Tools.Tool.Tool ( )

Definition at line 1652 of file Tools.cs.

1653 {
1654 tolerance = new ColorS(0, 0, 0);
1655 }

◆ Tool() [2/5]

BioGTK.Tools.Tool.Tool ( Type t)

Definition at line 1656 of file Tools.cs.

1657 {
1658 type = t;
1659 tolerance = new ColorS(0, 0, 0);
1660 }

◆ Tool() [3/5]

BioGTK.Tools.Tool.Tool ( Type t,
ColorS col )

Definition at line 1661 of file Tools.cs.

1662 {
1663 type = t;
1664 color = col;
1665 tolerance = new ColorS(0, 0, 0);
1666 }

◆ Tool() [4/5]

BioGTK.Tools.Tool.Tool ( Type t,
RectangleD r )

Definition at line 1667 of file Tools.cs.

1668 {
1669 type = t;
1670 rect = r;
1671 tolerance = new ColorS(0, 0, 0);
1672 }

◆ Tool() [5/5]

BioGTK.Tools.Tool.Tool ( Type t,
string sc )

Definition at line 1673 of file Tools.cs.

1674 {
1675 type = t;
1676 script = sc;
1677 tolerance = new ColorS(0, 0, 0);
1678 }

Member Function Documentation

◆ Init()

static void BioGTK.Tools.Tool.Init ( )
static

It adds all the tools to the tools list.

Definition at line 1598 of file Tools.cs.

1599 {
1600 int w = 33;
1601 int h = 33;
1602 string s = System.IO.Path.GetDirectoryName(Environment.ProcessPath) + "/";
1603 tools.Clear();
1604 if (tools.Count == 0)
1605 {
1606 int x = 0; int y = 0;
1607 foreach (Tool.Type t in (Tool.Type[])Enum.GetValues(typeof(Tool.Type)))
1608 {
1609 if (t != Type.script)
1610 if (t != Type.color1 && t != Type.color2)
1611 {
1612 Tool tool = new Tool(t, new ColorS(0, 0, 0));
1613 tool.bounds = new Rectangle(x * w, y * h, w, h);
1614 tool.image = new Pixbuf(s + "Images/" + tool.type.ToString() + ".png");
1615 tools.Add(tool.ToString(), tool);
1616 }
1617 else
1618 {
1619 Tool tool = new Tool(t, new ColorS(0, 0, 0));
1620 tool.bounds = new Rectangle(x * w, y * h, w, h);
1621 tools.Add(tool.ToString(), tool);
1622 }
1623 x++;
1624 if (x > Tools.gridW - 1)
1625 {
1626 x = 0;
1627 y++;
1628 }
1629 }
1630 }
1631 DrawColor = new ColorS(ushort.MaxValue, ushort.MaxValue, ushort.MaxValue);
1632 }

◆ ToString()

override string BioGTK.Tools.Tool.ToString ( )

Definition at line 1679 of file Tools.cs.

1680 {
1681 return type.ToString();
1682 }

Member Data Documentation

◆ bounds

Rectangle BioGTK.Tools.Tool.bounds

Definition at line 1637 of file Tools.cs.

◆ color

ColorS BioGTK.Tools.Tool.color

Definition at line 1651 of file Tools.cs.

◆ image

Pixbuf BioGTK.Tools.Tool.image

Definition at line 1636 of file Tools.cs.

◆ Points

List<AForge.Point> BioGTK.Tools.Tool.Points

Definition at line 1633 of file Tools.cs.

◆ script

string BioGTK.Tools.Tool.script

Definition at line 1648 of file Tools.cs.

◆ selected

bool BioGTK.Tools.Tool.selected

Definition at line 1635 of file Tools.cs.

◆ tolerance

ColorS BioGTK.Tools.Tool.tolerance

Definition at line 1650 of file Tools.cs.

◆ toolType

ToolType BioGTK.Tools.Tool.toolType

Definition at line 1634 of file Tools.cs.

◆ type

Type BioGTK.Tools.Tool.type

Definition at line 1649 of file Tools.cs.

Property Documentation

◆ Rectangle

RectangleD BioGTK.Tools.Tool.Rectangle
getset

Definition at line 1639 of file Tools.cs.

1640 {
1641 get { return rect; }
1642 set { rect = value; }
1643 }

◆ RectangleF

RectangleF BioGTK.Tools.Tool.RectangleF
get

Definition at line 1644 of file Tools.cs.

1645 {
1646 get { return new RectangleF((float)rect.X, (float)rect.Y, (float)rect.W, (float)rect.H); }
1647 }

The documentation for this class was generated from the following file: