public void AddImage(XmlElement el, ref zPictureBox img, System.Windows.Forms.Form f) { string location = el.GetAttribute("location"); string limg = el.GetAttribute("img"); string size = el.GetAttribute("size"); int X = int.Parse(location.Split(';')[0]); int Y = int.Parse(location.Split(';')[1]); Bitmap bmp = new Bitmap(Ipaybox.StartupPath + @"\" + limg); img = new zPictureBox(); img.Location = new Point(X, Y); img.Image = bmp; if (size != "") { X = int.Parse(size.Split(';')[0]); Y = int.Parse(size.Split(';')[1]); img.SizeMode = PictureBoxSizeMode.StretchImage; img.Size = new Size(X, Y); } else { img.Size = bmp.Size; } f.Controls.Add(img); }
public void AddButton(XmlElement el, ref zPictureBox img, System.Windows.Forms.Form f, EventHandler tar) { string location = el.GetAttribute("location"); string limg = el.GetAttribute("img"); string tag = el.GetAttribute("value"); int X = int.Parse(location.Split(';')[0]); int Y = int.Parse(location.Split(';')[1]); Bitmap tmp = new Bitmap(Ipaybox.StartupPath + @"\" + limg);//Ipaybox.Pics[int.Parse(Ipaybox.images[limg])]; img = new zPictureBox(); img.Location = new Point(X, Y); img.Image = tmp; img.Size = tmp.Size; img.Tag = tag; // НЕРАБОТАЕТ img.Click += tar; //f.Controls.Add(img); }