// ----------------------------------------------------------------------- // // Copyright 2013 MIT Licence. See licence.md for more information. // // ----------------------------------------------------------------------- namespace Perspex.Media { using System; using Perspex.Media.Imaging; /// /// Defines the interface through which drawing occurs. /// public interface IDrawingContext : IDisposable { Matrix CurrentTransform { get; } void DrawImage(IBitmap source, double opacity, Rect sourceRect, Rect destRect); /// /// Draws a line. /// /// The stroke pen. /// The first point of the line. /// The second point of the line. void DrawLine(Pen pen, Point p1, Point p2); /// /// Draws a geometry. /// /// The fill brush. /// The stroke pen. /// The geometry. void DrawGeometry(Brush brush, Pen pen, Geometry geometry); /// /// Draws the outline of a rectangle. /// /// The pen. /// The rectangle bounds. void DrawRectange(Pen pen, Rect rect); /// /// Draws text. /// /// The foreground brush. /// The upper-left corner of the text. /// The text. void DrawText(Brush foreground, Point origin, FormattedText text); /// /// Draws a filled rectangle. /// /// The brush. /// The rectangle bounds. void FillRectange(Brush brush, Rect rect); /// /// Pushes a clip rectange. /// /// The clip rectangle. /// A disposable used to undo the clip rectangle. IDisposable PushClip(Rect clip); /// /// Pushes a matrix transformation. /// /// The matrix /// A disposable used to undo the transformation. IDisposable PushTransform(Matrix matrix); } }