1
#region PDFsharp - A .NET library for processing PDF
4
// Stefan Lange (mailto:Stefan.Lange@pdfsharp.com)
6
// Copyright (c) 2005-2008 empira Software GmbH, Cologne (Germany)
8
// http://www.pdfsharp.com
9
// http://sourceforge.net/projects/pdfsharp
11
// Permission is hereby granted, free of charge, to any person obtaining a
12
// copy of this software and associated documentation files (the "Software"),
13
// to deal in the Software without restriction, including without limitation
14
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
15
// and/or sell copies of the Software, and to permit persons to whom the
16
// Software is furnished to do so, subject to the following conditions:
18
// The above copyright notice and this permission notice shall be included
19
// in all copies or substantial portions of the Software.
21
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
24
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27
// DEALINGS IN THE SOFTWARE.
35
using System.Drawing.Drawing2D;
38
using System.Windows.Media;
40
using PdfSharp.Internal;
42
namespace PdfSharp.Drawing
45
/// Represents an abstract drawing surface for PdfPages.
47
internal interface IXGraphicsRenderer
54
/// Fills the entire drawing surface with the specified color.
56
void Clear(XColor color);
59
/// Draws a straight line.
61
void DrawLine(XPen pen, double x1, double y1, double x2, double y2);
64
/// Draws a series of straight lines.
66
void DrawLines(XPen pen, XPoint[] points);
69
/// Draws a B�zier spline.
71
void DrawBezier(XPen pen, double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4);
74
/// Draws a series of B�zier splines.
76
void DrawBeziers(XPen pen, XPoint[] points);
79
/// Draws a cardinal spline.
81
void DrawCurve(XPen pen, XPoint[] points, double tension);
86
void DrawArc(XPen pen, double x, double y, double width, double height, double startAngle, double sweepAngle);
89
/// Draws a rectangle.
91
void DrawRectangle(XPen pen, XBrush brush, double x, double y, double width, double height);
94
/// Draws a series of rectangles.
96
void DrawRectangles(XPen pen, XBrush brush, XRect[] rects);
99
/// Draws a rectangle with rounded corners.
101
void DrawRoundedRectangle(XPen pen, XBrush brush, double x, double y, double width, double height, double ellipseWidth, double ellipseHeight);
104
/// Draws an ellipse.
106
void DrawEllipse(XPen pen, XBrush brush, double x, double y, double width, double height);
111
void DrawPolygon(XPen pen, XBrush brush, XPoint[] points, XFillMode fillmode);
116
void DrawPie(XPen pen, XBrush brush, double x, double y, double width, double height, double startAngle, double sweepAngle);
119
/// Draws a cardinal spline.
121
void DrawClosedCurve(XPen pen, XBrush brush, XPoint[] points, double tension, XFillMode fillmode);
124
/// Draws a graphical path.
126
void DrawPath(XPen pen, XBrush brush, XGraphicsPath path);
129
/// Draws a series of glyphs identified by the specified text and font.
131
void DrawString(string s, XFont font, XBrush brush, XRect layoutRectangle, XStringFormat format);
136
void DrawImage(XImage image, double x, double y, double width, double height);
137
void DrawImage(XImage image, XRect destRect, XRect srcRect, XGraphicsUnit srcUnit);
141
#region Save and Restore
144
/// Saves the current graphics state without changing it.
146
void Save(XGraphicsState state);
149
/// Restores the specified graphics state.
151
void Restore(XGraphicsState state);
156
void BeginContainer(XGraphicsContainer container, XRect dstrect, XRect srcrect, XGraphicsUnit unit);
161
void EndContainer(XGraphicsContainer container);
165
#region Transformation
167
//void TranslateTransform(double dx, double dy, XMatrixOrder order);
168
//void ScaleTransform(double scaleX, double scaleY, XMatrixOrder order);
169
//void ScaleTransform(double scaleXY, XMatrixOrder order);
170
//void RotateTransform(double angle, XMatrixOrder order);
171
//void MultiplyTransform(XMatrix matrix, XMatrixOrder order);
174
/// Sets all values that influence the page transformation.
176
void SetPageTransform(XPageDirection direction, XPoint origion, XGraphicsUnit unit);
179
/// Gets or sets the transformation matrix.
181
XMatrix Transform {/*get;*/ set;}
187
void SetClip(XGraphicsPath path, XCombineMode combineMode);
191
//public void SetClip(GraphicsPath path);
192
//public void SetClip(Graphics g);
193
//public void SetClip(Rectangle rect);
194
//public void SetClip(XRect rect);
195
//public void SetClip(GraphicsPath path, CombineMode combineMode);
196
//public void SetClip(Graphics g, CombineMode combineMode);
197
//public void SetClip(Rectangle rect, CombineMode combineMode);
198
//public void SetClip(XRect rect, CombineMode combineMode);
199
//public void SetClip(Region region, CombineMode combineMode);
200
//public void ExcludeClip(Rectangle rect);
201
//public void ExcludeClip(Region region);
202
//public void IntersectClip(Rectangle rect);
203
//public void IntersectClip(XRect rect);
204
//public void IntersectClip(Region region);
208
#region Miscellaneous
210
/// Writes a comment to the output stream. Comments have no effect on the rendering of the output.
212
void WriteComment(string comment);