public LeCanvas(Control canvas) { xmlShapes = new XMLShapes(); Canvas = canvas; myMenu = new LeMenu(); self = this; }
public void Save(String fileName) { if (fileName.ToUpper().EndsWith("XML")) { LeMenu.ExportToXML(fileName); } else { if (Canvas is PictureBox) { PictureBox me = (Canvas as PictureBox); Image myImage = new System.Drawing.Bitmap(me.Width, me.Height); Graphics g = System.Drawing.Graphics.FromImage(myImage); g.FillRectangle(new SolidBrush(Color.White), 0, 0, me.Width, me.Height); foreach (LeShape shape in xmlShapes.GetList()) { shape.Paint(this, g); } me.Image = myImage; myImage.Save(fileName, System.Drawing.Imaging.ImageFormat.Jpeg); } } }
public LeMenu() { self = this; }
public void Load(string fileName) { LeMenu.DeSerializeXML(fileName); }