Esempio n. 1
0
 private void hide_Click(object sender, EventArgs e)
 {
     if (CoordinatesystemFlag == true)
     {
         TIS.Imaging.OverlayBitmap ob = icImagingControl1.OverlayBitmapAtPath[TIS.Imaging.PathPositions.Device];
         ob.DrawSolidRect(ob.DropOutColor, 0, 0,
                          1031, 774);
         CoordinatesystemFlag = false;
         hide.Text            = "Show the scale";
     }
     else
     {
         CoordinatesystemFlag = true;
         hide.Text            = "Hide the scale";
     }
 }
Esempio n. 2
0
        private void icImagingControl1_OverlayUpdate(object sender, TIS.Imaging.ICImagingControl.OverlayUpdateEventArgs e)
        {
            TIS.Imaging.OverlayBitmap ob = e.overlay;

            int lineIndex = m_sink.FrameCount % 25;

            if (lineIndex == 0)
            {
                ob.DrawSolidRect(ob.DropOutColor, 10, icImagingControl1.ImageHeight - 70, 62,
                                 icImagingControl1.ImageHeight - 9);
            }

            /*ob.DrawLine(Color.Black, lineIndex * 2 + 10,
             *                              icImagingControl1.ImageHeight - 10,
             *                              lineIndex * 2 + 10,
             *                              icImagingControl1.ImageHeight - 10 - lineIndex);*/

            // Print the current frame number:
            // Set the background color to the current dropout color
            // and make the font opaque.
            ob.FontBackColor   = ob.DropOutColor;
            ob.FontTransparent = false;

            // Save the current font.
            Font OldFont = ob.Font;

            // Draw the text.
            ob.Font = new Font("Arial", 8);
            ob.DrawSolidRect(ob.DropOutColor, 0, 0, 1031, 774);

            if (CoordinatesystemFlag == true)
            {
                //DrawCoordinatesystem(icImagingControl1.OverlayBitmapAtPath[PathPositions.Device]);
            }

            ob.DrawText(Color.Black, textBox1.Location.X, textBox1.Location.Y, textBox1.Text);
            ob.DrawText(Color.Black, textBox2.Location.X, textBox2.Location.Y, textBox2.Text);
            ob.DrawText(Color.Black, textBox3.Location.X, textBox3.Location.Y, textBox3.Text);
            ob.DrawText(Color.Black, textBox4.Location.X, textBox4.Location.Y, textBox4.Text);
            ob.DrawText(Color.Black, textBox5.Location.X, textBox5.Location.Y, textBox5.Text);

            if ((textBox1.Text == "") || (textBox2.Text == ""))
            {
                ob.DrawSolidRect(ob.DropOutColor, 0, 0, 1031, 774);
                if (CoordinatesystemFlag == true)
                {
                    //DrawCoordinatesystem(icImagingControl1.OverlayBitmapAtPath[PathPositions.Device]);
                }
            }
            else
            {
                if (cycle.Checked == true)
                {
                    ob.DrawFrameEllipse(Color.Black, textBox1.Location.X, textBox1.Location.Y, textBox2.Location.X, textBox2.Location.Y);
                    ob.DrawFrameRect(Color.Black, textBox1.Location.X, textBox1.Location.Y, textBox2.Location.X, textBox2.Location.Y);
                }
                else
                {
                    ob.DrawLine(Color.Black, textBox1.Location.X, textBox1.Location.Y, textBox2.Location.X, textBox2.Location.Y);
                    if (textBox3.Text != "")
                    {
                        if (segment.Checked == true)
                        {
                        }
                        else if (triangle.Checked == true)
                        {
                            ob.DrawLine(Color.Black, textBox1.Location.X, textBox1.Location.Y, textBox3.Location.X, textBox3.Location.Y);
                            ob.DrawLine(Color.Black, textBox2.Location.X, textBox2.Location.Y, textBox3.Location.X, textBox3.Location.Y);
                        }
                        else if (quadrilateral.Checked == true && textBox4.Text != "")
                        {
                            ob.DrawLine(Color.Black, textBox1.Location.X, textBox1.Location.Y, textBox4.Location.X, textBox4.Location.Y);
                            ob.DrawLine(Color.Black, textBox2.Location.X, textBox2.Location.Y, textBox3.Location.X, textBox3.Location.Y);
                            ob.DrawLine(Color.Black, textBox3.Location.X, textBox3.Location.Y, textBox4.Location.X, textBox4.Location.Y);
                        }
                    }
                }
            }

            // Restore the previously used font.
            ob.Font = OldFont;
        }