예제 #1
0
파일: Dibujo.cs 프로젝트: jmjackson/Graph
        private void Dibujo_Load(object sender, EventArgs e)
        {
            myPaint = Pdibujo.CreateGraphics();

            var Pn = db.ProjectDevs.Include(a => a.Project).Where(a => a.Id == pdId).FirstOrDefault();


            var projectno = (from d in db.Developments where d.ProjectDevId == Pn.Id select d).ToList();
            var seamno    = (from s in db.GeoMembranes where s.ProjectDevId == Pn.Id select s).ToList();

            foreach (var item in projectno)
            {
                ListBoxData.Items.Add(item.PanelNo);
            }
            foreach (var item in seamno)
            {
                SNOList.Items.Add(item.Id + "-" + item.SeamNo);
            }

            //if (Pn.ImageDev!=null)
            //{
            //    var picture = Convert.ToBase64String(Pn.ImageDev);
            //    PbLienzo.Image = Image.FromStream(new MemoryStream(Convert.FromBase64String(picture)));
            //}
        }
예제 #2
0
파일: Dibujo.cs 프로젝트: jmjackson/Graph
        private void BtnExport_Click(object sender, EventArgs e)
        {
            bmp = new Bitmap(Pdibujo.Width, Pdibujo.Height);
            Pdibujo.DrawToBitmap(bmp, new Rectangle(0, 0, Pdibujo.Width, Pdibujo.Height));
            SaveFileDialog saveFileDialog = new SaveFileDialog();

            saveFileDialog.DefaultExt = "bmp";
            saveFileDialog.Filter     = "Bitmap files|*.bmp";
            if (saveFileDialog.ShowDialog() == DialogResult.OK)
            {
                bmp.Save(saveFileDialog.FileName);
            }
        }