示例#1
0
        public LeCanvas(Control canvas)
        {
            xmlShapes = new XMLShapes();
            Canvas    = canvas;

            myMenu = new LeMenu();
            self   = this;
        }
示例#2
0
        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);
                }
            }
        }
示例#3
0
 public LeMenu()
 {
     self = this;
 }
示例#4
0
 public void Load(string fileName)
 {
     LeMenu.DeSerializeXML(fileName);
 }