Exemple #1
0
        private void ShowRubberBandForm()
        {
            if (rbfIsBeingShown)
            {
                return;
            }

            rbfIsBeingShown = true;

            if (bitmap != null)
            {
                this.pictureBox1.Image = null;
                bitmap.Dispose();
            }

            using (RubberBandForm rbf = new RubberBandForm(this))
            {
                rbf.ShowDialog();
                Size sLastSize = rbf.lastSize;
                if (sLastSize.Width > 0 && sLastSize.Height > 0)
                {
                    Rectangle r = new Rectangle();
                    r.Location = rbf.lastLoc;
                    r.Size     = sLastSize;
                    CaptureBitmap(r);
                }
            }

            this.Show();
            rbfIsBeingShown = false;
        }
Exemple #2
0
        private void ShowRubberBandForm()
        {
            if (rbfIsBeingShown)
            {
                return;
            }

            rbfIsBeingShown = true;

            if (bitmap != null)
            {
                this.pictureBox1.Image = null;
                bitmap.Dispose();
                strokes.Clear();
            }


            using (RubberBandForm rbf = new RubberBandForm(this))
            {
                rbf.ShowDialog();

                //Ash <2010-08-03>
                // To remove the "marshal-by-reference" warning we declare the last size as
                // a local variable.
                Size sLastSize = rbf.lastSize;

                //if (rbf.lastSize.Width > 0 && rbf.lastSize.Height > 0)
                if (sLastSize.Width > 0 && sLastSize.Height > 0)
                {
                    Rectangle r = new Rectangle();
                    r.Location = rbf.lastLoc;
                    //r.Size = rbf.lastSize;
                    r.Size = sLastSize;
                    CaptureBitmap(r);
                }
                //End Ash <2010-08-03>
            }

            this.Show();
            rbfIsBeingShown = false;
        }
Exemple #3
0
        private void ShowRubberBandForm()
        {
            if (rbfIsBeingShown)
                return;

            rbfIsBeingShown = true;

            if (bitmap != null)
            {
                this.pictureBox1.Image = null;
                bitmap.Dispose();
                strokes.Clear();
            }


            using (RubberBandForm rbf = new RubberBandForm(this))
            {

                rbf.ShowDialog();

                //Ash <2010-08-03>
                // To remove the "marshal-by-reference" warning we declare the last size as
                // a local variable.
                Size sLastSize = rbf.lastSize;

                //if (rbf.lastSize.Width > 0 && rbf.lastSize.Height > 0)
                if (sLastSize.Width > 0 && sLastSize.Height > 0)
                {
                    Rectangle r = new Rectangle();
                    r.Location = rbf.lastLoc;
                    //r.Size = rbf.lastSize;
                    r.Size = sLastSize;
                    CaptureBitmap(r);
                }
                //End Ash <2010-08-03>
            }

            this.Show();
            rbfIsBeingShown = false;
        }