public void DrawSurface(Point start, double width, double height, ISurface surface, ScaleMode mode, bool masked = false) { //FIXME: This still needs support for masked surfaces double scaleX, scaleY; Point offset; BaseImage <Pixbuf> .ScaleFactor((int)(surface.Width *surface.DeviceScaleFactor), (int)(surface.Height *surface.DeviceScaleFactor), (int)width, (int)height, mode, out scaleX, out scaleY, out offset); CContext.Save(); CContext.Translate(offset.X + start.X, offset.Y + start.Y); CContext.Scale(scaleX, scaleY); if (masked) { CContext.PushGroup(); } ImageSurface image = surface.Value as ImageSurface; CContext.SetSourceSurface(image, 0, 0); CContext.Rectangle(0, 0, image.Width, image.Height); CContext.Fill(); if (masked) { var src = CContext.PopGroup(); SetColor(FillColor); CContext.Mask(src); src.Dispose(); } CContext.Restore(); }
public void DrawRectangle(Point start, double width, double height) { CContext.Rectangle(new global::Cairo.Rectangle(start.X + LineWidth / 2, start.Y + LineWidth / 2, width - LineWidth, height - LineWidth)); StrokeAndFill(false); }
public void Clip(Area area) { if (!disableScalling) { CContext.Rectangle(area.Start.X, area.Start.Y, area.Width, area.Height); CContext.Clip(); } }
public void DrawSurface(ISurface surface, Point p = null) { ImageSurface image; image = surface.Value as ImageSurface; if (p == null) { CContext.SetSourceSurface(image, 0, 0); CContext.Paint(); } else { CContext.SetSourceSurface(image, (int)p.X, (int)p.Y); CContext.Rectangle(p.X, p.Y, image.Width, image.Height); CContext.Fill(); } }
public void Clip(Area area) { CContext.Rectangle(area.Start.X, area.Start.Y, area.Width, area.Height); CContext.Clip(); }