public void OnDeserialization(object sender) { region = Region.Rectangle(Rectangle.Zero); Rectangle[] rects = new Rectangle[placedSurfaces.Count]; for (int i = 0; i < placedSurfaces.Count; ++i) { rects[i] = placedSurfaces[i].Bounds; } region = Utility.RectanglesToRegion(rects); }
public IrregularSurface(Cairo.ImageSurface source, Rectangle[] roi) { this.placedSurfaces = new List <PlacedSurface> (roi.Length); foreach (Rectangle rect in roi) { Rectangle ri = Rectangle.Intersect(source.GetBounds(), rect); if (!ri.IsEmpty) { this.placedSurfaces.Add(new PlacedSurface(source, ri)); } } this.region = Utility.RectanglesToRegion(roi); this.region.Intersect(Region.Rectangle(source.GetBounds())); }