BioImager  4.9.0
A .NET microscopy imaging application based on Bio library. Supports various microscopes by using imported libraries & GUI automation. Supports XInput game controllers to move stage, take images, run ImageJ macros on images or Bio C# scripts.
Loading...
Searching...
No Matches
BioImager.ColorTool Class Reference
Inheritance diagram for BioImager.ColorTool:

Public Member Functions

void UpdateGUI ()
 It updates the GUI.
 
 ColorTool (ColorS col, int bitPerPixel)
 

Protected Member Functions

override void Dispose (bool disposing)
 Clean up any resources being used.
 

Properties

ColorS Color [get, set]
 

Detailed Description

Definition at line 3 of file ColorTool.Designer.cs.

Constructor & Destructor Documentation

◆ ColorTool() [1/2]

BioImager.ColorTool.ColorTool ( )

Definition at line 44 of file ColorTool.cs.

45 {
46 InitializeComponent();
47 UpdateGUI();
48 }
void UpdateGUI()
It updates the GUI.
Definition ColorTool.cs:32

◆ ColorTool() [2/2]

BioImager.ColorTool.ColorTool ( ColorS col,
int bitPerPixel )

Definition at line 50 of file ColorTool.cs.

51 {
52 InitializeComponent();
53 this.bitsPerPixel = bitPerPixel;
54 if(bitsPerPixel == 8)
55 {
56 rBar.Maximum = 255;
57 gBar.Maximum = 255;
58 bBar.Maximum = 255;
59 redBox.Maximum = 255;
60 greenBox.Maximum = 255;
61 blueBox.Maximum = 255;
62 }
63 if (rBar.Maximum <= col.R)
64 rBar.Value = rBar.Maximum;
65 if (gBar.Maximum <= col.G)
66 gBar.Value = gBar.Maximum;
67 if (bBar.Maximum <= col.B)
68 bBar.Value = bBar.Maximum;
69 UpdateGUI();
70 }

Member Function Documentation

◆ Dispose()

override void BioImager.ColorTool.Dispose ( bool disposing)
protected

Clean up any resources being used.

Parameters
disposingtrue if managed resources should be disposed; otherwise, false.

Definition at line 14 of file ColorTool.Designer.cs.

15 {
16 if (disposing && (components != null))
17 {
18 components.Dispose();
19 }
20 base.Dispose(disposing);
21 }

◆ UpdateGUI()

void BioImager.ColorTool.UpdateGUI ( )

It updates the GUI.

Definition at line 32 of file ColorTool.cs.

33 {
34 color = new ColorS((ushort)redBox.Value, (ushort)greenBox.Value, (ushort)blueBox.Value);
35 colorPanel.BackColor = System.Drawing.Color.FromArgb((int)(((float)color.R / (float)ushort.MaxValue) * 255),(int)(((float)color.G / (float)ushort.MaxValue) * 255),(int)(((float)color.B / (float)ushort.MaxValue) * 255));
36 if (rBar.Value != redBox.Value)
37 redBox.Value = rBar.Value;
38 if (gBar.Value != greenBox.Value)
39 greenBox.Value = gBar.Value;
40 if (bBar.Value != blueBox.Value)
41 blueBox.Value = bBar.Value;
42 }

Property Documentation

◆ Color

ColorS BioImager.ColorTool.Color
getset

Definition at line 19 of file ColorTool.cs.

20 {
21 get
22 {
23 return color;
24 }
25 set
26 {
27 color = value;
28 }
29 }

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