public static void AddImage(zeus.HelperClass.zImage image, ref zPictureBox img) { string location = image.location; string limg = image.src; string size = image.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; } }
public static void AddImage(zeus.HelperClass.zImage zimg, ref zPictureBox img, System.Windows.Forms.Form f) { string location = zimg.location; string limg = zimg.src; string size = zimg.size; int X = int.Parse(location.Split(';')[0]); int Y = int.Parse(location.Split(';')[1]); Bitmap bmp = new Bitmap(Ipaybox.StartupPath + @"\" + limg); bmp.MakeTransparent(); img = new zPictureBox(); img.Location = new Point(X, Y); img.Image = bmp; img.Tag = ""; if (zimg.type == "solid" || zimg.type == "alert") { img.BackColor = Color.White; } else if (zimg.type == "error") { img.Visible = false; img.BackColor = Color.White; } else { img.BackColor = Color.Transparent; } 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); }