public static GalleryImageSource FromImage(Image image) { var imageSource = new GalleryImageSource(); if (image != null) { imageSource.OriginalImage = new Bitmap(image); imageSource.BigImage = image.Resize(new Size((Int32)BigWidth, (Int32)BigHeight)); imageSource.SmallImage = image.Resize(new Size((Int32)SmallWidth, (Int32)SmallHeight)); imageSource.TinyImage = image.Resize(new Size((Int32)TinyWidth, (Int32)TinyHeight)); imageSource.XtraTinyImage = image.Resize(new Size((Int32)XtraTinyWidth, (Int32)XtraTinyHeight)); }; return imageSource; }
public GalleryImageSource Clone() { var result = new GalleryImageSource(); if (OriginalImage != null && BigImage != null && SmallImage != null && TinyImage != null && XtraTinyImage != null) { result.OriginalImage = OriginalImage.Clone() as Image; result.BigImage = BigImage.Clone() as Image; result.SmallImage = SmallImage.Clone() as Image; result.TinyImage = TinyImage.Clone() as Image; result.XtraTinyImage = XtraTinyImage.Clone() as Image; } result.Name = Name; return result; }