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 1633 of file Tools.cs.

Member Enumeration Documentation

◆ ToolType

enum BioGTK.Tools.Tool.ToolType

Definition at line 1638 of file Tools.cs.

1639 {
1640 color,
1641 annotation,
1642 select,
1643 function
1644 }

◆ Type

enum BioGTK.Tools.Tool.Type

Definition at line 1645 of file Tools.cs.

1646 {
1647 pan,
1648 move,
1649 point,
1650 line,
1651 rect,
1652 ellipse,
1653 polygon,
1654 text,
1655 delete,
1656 freeform,
1657 magic,
1658 brush,
1659 bucket,
1660 eraser,
1661 dropper,
1662 switchColors,
1663 color1,
1664 color2,
1665 script,
1666 }

Constructor & Destructor Documentation

◆ Tool() [1/5]

BioGTK.Tools.Tool.Tool ( )

Definition at line 1723 of file Tools.cs.

1724 {
1725 tolerance = new ColorS(0, 0, 0);
1726 }

◆ Tool() [2/5]

BioGTK.Tools.Tool.Tool ( Type t)

Definition at line 1727 of file Tools.cs.

1728 {
1729 type = t;
1730 tolerance = new ColorS(0, 0, 0);
1731 }

◆ Tool() [3/5]

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

Definition at line 1732 of file Tools.cs.

1733 {
1734 type = t;
1735 color = col;
1736 tolerance = new ColorS(0, 0, 0);
1737 }

◆ Tool() [4/5]

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

Definition at line 1738 of file Tools.cs.

1739 {
1740 type = t;
1741 rect = r;
1742 tolerance = new ColorS(0, 0, 0);
1743 }

◆ Tool() [5/5]

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

Definition at line 1744 of file Tools.cs.

1745 {
1746 type = t;
1747 script = sc;
1748 tolerance = new ColorS(0, 0, 0);
1749 }

Member Function Documentation

◆ Init()

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

It adds all the tools to the tools list.

Definition at line 1669 of file Tools.cs.

1670 {
1671 int w = 33;
1672 int h = 33;
1673 string s = System.IO.Path.GetDirectoryName(Environment.ProcessPath) + "/";
1674 tools.Clear();
1675 if (tools.Count == 0)
1676 {
1677 int x = 0; int y = 0;
1678 foreach (Tool.Type t in (Tool.Type[])Enum.GetValues(typeof(Tool.Type)))
1679 {
1680 if (t != Type.script)
1681 if (t != Type.color1 && t != Type.color2)
1682 {
1683 Tool tool = new Tool(t, new ColorS(0, 0, 0));
1684 tool.bounds = new Rectangle(x * w, y * h, w, h);
1685 tool.image = new Pixbuf(s + "Images/" + tool.type.ToString() + ".png");
1686 tools.Add(tool.ToString(), tool);
1687 }
1688 else
1689 {
1690 Tool tool = new Tool(t, new ColorS(0, 0, 0));
1691 tool.bounds = new Rectangle(x * w, y * h, w, h);
1692 tools.Add(tool.ToString(), tool);
1693 }
1694 x++;
1695 if (x > Tools.gridW - 1)
1696 {
1697 x = 0;
1698 y++;
1699 }
1700 }
1701 }
1702 DrawColor = new ColorS(ushort.MaxValue, ushort.MaxValue, ushort.MaxValue);
1703 }

◆ ToString()

override string BioGTK.Tools.Tool.ToString ( )

Definition at line 1750 of file Tools.cs.

1751 {
1752 return type.ToString();
1753 }

Member Data Documentation

◆ bounds

Rectangle BioGTK.Tools.Tool.bounds

Definition at line 1708 of file Tools.cs.

◆ color

ColorS BioGTK.Tools.Tool.color

Definition at line 1722 of file Tools.cs.

◆ image

Pixbuf BioGTK.Tools.Tool.image

Definition at line 1707 of file Tools.cs.

◆ Points

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

Definition at line 1704 of file Tools.cs.

◆ script

string BioGTK.Tools.Tool.script

Definition at line 1719 of file Tools.cs.

◆ selected

bool BioGTK.Tools.Tool.selected

Definition at line 1706 of file Tools.cs.

◆ tolerance

ColorS BioGTK.Tools.Tool.tolerance

Definition at line 1721 of file Tools.cs.

◆ toolType

ToolType BioGTK.Tools.Tool.toolType

Definition at line 1705 of file Tools.cs.

◆ type

Type BioGTK.Tools.Tool.type

Definition at line 1720 of file Tools.cs.

Property Documentation

◆ Rectangle

RectangleD BioGTK.Tools.Tool.Rectangle
getset

Definition at line 1710 of file Tools.cs.

1711 {
1712 get { return rect; }
1713 set { rect = value; }
1714 }

◆ RectangleF

RectangleF BioGTK.Tools.Tool.RectangleF
get

Definition at line 1715 of file Tools.cs.

1716 {
1717 get { return new RectangleF((float)rect.X, (float)rect.Y, (float)rect.W, (float)rect.H); }
1718 }

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