55 {
56 InitializeComponent();
57 pen = p;
58 bitsPerPixel = bitPerPixel;
59 if (bitsPerPixel == 8)
60 {
61 rBar.Maximum = 255;
62 gBar.Maximum = 255;
63 bBar.Maximum = 255;
64 redBox.Maximum = 255;
65 greenBox.Maximum = 255;
66 blueBox.Maximum = 255;
67 }
68 if (rBar.Maximum <= p.color.R)
69 rBar.Value = rBar.Maximum;
70 if (gBar.Maximum <= p.color.G)
71 gBar.Value = gBar.Maximum;
72 if (bBar.Maximum <= p.color.B)
73 bBar.Value = bBar.Maximum;
74 this.tolerance = tolerance;
75 tolRBox.Value = (decimal)tolerance.R;
76 tolGBox.Value = (decimal)tolerance.G;
77 tolBBox.Value = (decimal)tolerance.B;
80 }