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))); //} }
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); } }