Exemplo n.º 1
0
        public void RestoreNonSerializable(DrawingCanvas parent)
        {
            invalidationList  = new List <short>(10);
            copyIndexes       = new List <short>(2);
            isDirty           = false;
            parent.MouseDown += new MouseEventHandler(parent_MouseDown);
            parent.MouseUp   += new MouseEventHandler(parent_MouseUp);
            parent.MouseMove += new MouseEventHandler(parent_MouseMove);
            shapeClipRect     = new ShapeClipRectangle();

            refControl  = parent;
            intCurIndex = -1;

            for (short i = 0; i < shapes.Count; i++)
            {
                this.shapes[i].RestoreNonSerializable();
            }
            try
            {
                if (strBackBmpPath != "" &&
                    strBackBmpPath != null)
                {
                    backBmp = new Bitmap(strBackBmpPath);
                    refControl.Invalidate();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Background Image Load Error");
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Will paint the background with the bitmap passed in.
 /// (Commonly used for tracing out a shape from an image)
 /// </summary>
 /// <param name="bmp"></param>
 /// <param name="pnt"></param>
 public void SetBackBitmap(Bitmap bmp, string filePath)
 {
     if (bmp == null && backBmp != null)
     {
         backBmp.Dispose();
         backBmp = null;
     }
     else
     {
         backBmp        = bmp;
         strBackBmpPath = filePath;
         refControl.Invalidate();
     }
 }
Exemplo n.º 3
0
        public void RestoreNonSerializable(DrawingCanvas parent)
        {
            invalidationList = new List<short>(10);
            copyIndexes = new List<short>(2);
            isDirty = false;
            parent.MouseDown += new MouseEventHandler(parent_MouseDown);
            parent.MouseUp += new MouseEventHandler(parent_MouseUp);
            parent.MouseMove += new MouseEventHandler(parent_MouseMove);
            shapeClipRect = new ShapeClipRectangle();

            refControl = parent;
            intCurIndex = -1;

            for (short i = 0; i < shapes.Count; i++)
            {
                this.shapes[i].RestoreNonSerializable();
            }
            try
            {
                if (strBackBmpPath != "" &&
                    strBackBmpPath != null)
                {
                    backBmp = new Bitmap(strBackBmpPath);
                    refControl.Invalidate();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Background Image Load Error");
            }
        }