Example #1
0
 private void InitialValue()
 {
     gShow.SmoothingMode = SmoothingMode.HighQuality;
     selectBitmap        = (Bitmap)finalBitmap.Clone();
     tempBitmap          = (Bitmap)finalBitmap.Clone();
     gSelect             = Graphics.FromImage(selectBitmap);
     gTemp          = Graphics.FromImage(tempBitmap);
     elementManager = new ElementManager();
 }
Example #2
0
        public void Open()
        {
            OpenFileDialog open = new OpenFileDialog();

            open.Filter           = @"电子图纸|*.cpet";
            open.RestoreDirectory = true;
            if (open.ShowDialog() == DialogResult.OK)
            {
                FileStream fileStream = new FileStream(open.FileName, FileMode.Open, FileAccess.Read, FileShare.Read);
                int        fsLen      = (int)fileStream.Length;
                byte[]     heByte     = new byte[fsLen];
                fileStream.Read(heByte, 0, heByte.Length);
                this.elementManager = SerializeHelper.DeserializeWithBinary <ElementManager>(heByte);
                fileStream.Close();
            }
            DrawFinalBitmap();
        }