1 //-------------------------------------------------------------
2 // <copyright company=
\92Microsoft Corporation
\92>
3 // Copyright © Microsoft Corporation. All Rights Reserved.
5 //-------------------------------------------------------------
6 // @owner=alexgor, deliant
7 //=================================================================
8 // File: IChartRenderingEngine.cs
10 // Namespace: DataVisualization.Charting
12 // Classes: IChartRenderingEngine, IChartAnimationEngine
14 // Purpose: Defines interfaces which must be implemented by
15 // every rendering and animation engine class. These
16 // interfaces are used in GDI+, SVG and Flash rendering.
17 // Note that animation is only available in SVG and
18 // Flash rendering engines.
20 // Reviwed: AG - Jul 15, 2003
21 // AG - MArch 14, 2007
23 //===================================================================
25 #region Used namespaces
29 using System.Drawing.Drawing2D;
30 using System.Drawing.Text;
31 using System.Drawing.Imaging;
32 using System.ComponentModel;
33 using System.Collections;
38 namespace System.Windows.Forms.DataVisualization.Charting
40 namespace System.Web.UI.DataVisualization.Charting
45 /// IChartRenderingEngine interface defines a set of methods and properties
46 /// which must be implemented by any chart rendering engine. It contains
47 /// methods for drawing basic shapes.
49 internal interface IChartRenderingEngine
51 #region Drawing Methods
54 /// Draws a line connecting two PointF structures.
56 /// <param name="pen">Pen object that determines the color, width, and style of the line.</param>
57 /// <param name="pt1">PointF structure that represents the first point to connect.</param>
58 /// <param name="pt2">PointF structure that represents the second point to connect.</param>
66 /// Draws a line connecting the two points specified by coordinate pairs.
68 /// <param name="pen">Pen object that determines the color, width, and style of the line.</param>
69 /// <param name="x1">x-coordinate of the first point.</param>
70 /// <param name="y1">y-coordinate of the first point.</param>
71 /// <param name="x2">x-coordinate of the second point.</param>
72 /// <param name="y2">y-coordinate of the second point.</param>
82 /// Draws the specified portion of the specified Image object at the specified location and with the specified size.
84 /// <param name="image">Image object to draw.</param>
85 /// <param name="destRect">Rectangle structure that specifies the location and size of the drawn image. The image is scaled to fit the rectangle.</param>
86 /// <param name="srcX">x-coordinate of the upper-left corner of the portion of the source image to draw.</param>
87 /// <param name="srcY">y-coordinate of the upper-left corner of the portion of the source image to draw.</param>
88 /// <param name="srcWidth">Width of the portion of the source image to draw.</param>
89 /// <param name="srcHeight">Height of the portion of the source image to draw.</param>
90 /// <param name="srcUnit">Member of the GraphicsUnit enumeration that specifies the units of measure used to determine the source rectangle.</param>
91 /// <param name="imageAttr">ImageAttributes object that specifies recoloring and gamma information for the image object.</param>
93 System.Drawing.Image image,
100 ImageAttributes imageAttr
104 /// Draws an ellipse defined by a bounding rectangle specified by
105 /// a pair of coordinates, a height, and a width.
107 /// <param name="pen">Pen object that determines the color, width, and style of the ellipse.</param>
108 /// <param name="x">x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.</param>
109 /// <param name="y">y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.</param>
110 /// <param name="width">Width of the bounding rectangle that defines the ellipse.</param>
111 /// <param name="height">Height of the bounding rectangle that defines the ellipse.</param>
121 /// Draws a cardinal spline through a specified array of PointF structures
122 /// using a specified tension. The drawing begins offset from
123 /// the beginning of the array.
125 /// <param name="pen">Pen object that determines the color, width, and height of the curve.</param>
126 /// <param name="points">Array of PointF structures that define the spline.</param>
127 /// <param name="offset">Offset from the first element in the array of the points parameter to the starting point in the curve.</param>
128 /// <param name="numberOfSegments">Number of segments after the starting point to include in the curve.</param>
129 /// <param name="tension">Value greater than or equal to 0.0F that specifies the tension of the curve.</param>
134 int numberOfSegments,
139 /// Draws a rectangle specified by a coordinate pair, a width, and a height.
141 /// <param name="pen">Pen object that determines the color, width, and style of the rectangle.</param>
142 /// <param name="x">x-coordinate of the upper-left corner of the rectangle to draw.</param>
143 /// <param name="y">y-coordinate of the upper-left corner of the rectangle to draw.</param>
144 /// <param name="width">Width of the rectangle to draw.</param>
145 /// <param name="height">Height of the rectangle to draw.</param>
155 /// Draws a polygon defined by an array of PointF structures.
157 /// <param name="pen">Pen object that determines the color, width, and style of the polygon.</param>
158 /// <param name="points">Array of PointF structures that represent the vertices of the polygon.</param>
165 /// Draws the specified text string in the specified rectangle with the specified Brush and Font objects using the formatting properties of the specified StringFormat object.
167 /// <param name="s">String to draw.</param>
168 /// <param name="font">Font object that defines the text format of the string.</param>
169 /// <param name="brush">Brush object that determines the color and texture of the drawn text.</param>
170 /// <param name="layoutRectangle">RectangleF structure that specifies the location of the drawn text.</param>
171 /// <param name="format">StringFormat object that specifies formatting properties, such as line spacing and alignment, that are applied to the drawn text.</param>
176 RectangleF layoutRectangle,
181 /// Draws the specified text string at the specified location with the specified Brush and Font objects using the formatting properties of the specified StringFormat object.
183 /// <param name="s">String to draw.</param>
184 /// <param name="font">Font object that defines the text format of the string.</param>
185 /// <param name="brush">Brush object that determines the color and texture of the drawn text.</param>
186 /// <param name="point">PointF structure that specifies the upper-left corner of the drawn text.</param>
187 /// <param name="format">StringFormat object that specifies formatting properties, such as line spacing and alignment, that are applied to the drawn text.</param>
197 /// Draws the specified portion of the specified Image object at the specified location and with the specified size.
199 /// <param name="image">Image object to draw.</param>
200 /// <param name="destRect">Rectangle structure that specifies the location and size of the drawn image. The image is scaled to fit the rectangle.</param>
201 /// <param name="srcX">x-coordinate of the upper-left corner of the portion of the source image to draw.</param>
202 /// <param name="srcY">y-coordinate of the upper-left corner of the portion of the source image to draw.</param>
203 /// <param name="srcWidth">Width of the portion of the source image to draw.</param>
204 /// <param name="srcHeight">Height of the portion of the source image to draw.</param>
205 /// <param name="srcUnit">Member of the GraphicsUnit enumeration that specifies the units of measure used to determine the source rectangle.</param>
206 /// <param name="imageAttrs">ImageAttributes object that specifies recoloring and gamma information for the image object.</param>
208 System.Drawing.Image image,
214 GraphicsUnit srcUnit,
215 ImageAttributes imageAttrs
219 /// Draws a rectangle specified by a coordinate pair, a width, and a height.
221 /// <param name="pen">A Pen object that determines the color, width, and style of the rectangle.</param>
222 /// <param name="x">The x-coordinate of the upper-left corner of the rectangle to draw.</param>
223 /// <param name="y">The y-coordinate of the upper-left corner of the rectangle to draw.</param>
224 /// <param name="width">The width of the rectangle to draw.</param>
225 /// <param name="height">The height of the rectangle to draw.</param>
235 /// Draws a GraphicsPath object.
237 /// <param name="pen">Pen object that determines the color, width, and style of the path.</param>
238 /// <param name="path">GraphicsPath object to draw.</param>
245 /// Draws a pie shape defined by an ellipse specified by a coordinate pair, a width, and a height and two radial lines.
247 /// <param name="pen">Pen object that determines the color, width, and style of the pie shape.</param>
248 /// <param name="x">x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie shape comes.</param>
249 /// <param name="y">y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie shape comes.</param>
250 /// <param name="width">Width of the bounding rectangle that defines the ellipse from which the pie shape comes.</param>
251 /// <param name="height">Height of the bounding rectangle that defines the ellipse from which the pie shape comes.</param>
252 /// <param name="startAngle">Angle measured in degrees clockwise from the x-axis to the first side of the pie shape.</param>
253 /// <param name="sweepAngle">Angle measured in degrees clockwise from the startAngle parameter to the second side of the pie shape.</param>
265 /// Draws an arc representing a portion of an ellipse specified by a pair of coordinates, a width, and a height.
267 /// <param name="pen">Pen object that determines the color, width, and style of the arc.</param>
268 /// <param name="x">x-coordinate of the upper-left corner of the rectangle that defines the ellipse.</param>
269 /// <param name="y">y-coordinate of the upper-left corner of the rectangle that defines the ellipse.</param>
270 /// <param name="width">Width of the rectangle that defines the ellipse.</param>
271 /// <param name="height">Height of the rectangle that defines the ellipse.</param>
272 /// <param name="startAngle">Angle in degrees measured clockwise from the x-axis to the starting point of the arc.</param>
273 /// <param name="sweepAngle">Angle in degrees measured clockwise from the startAngle parameter to ending point of the arc.</param>
285 /// Draws the specified Image object at the specified location and with the specified size.
287 /// <param name="image">Image object to draw.</param>
288 /// <param name="rect">RectangleF structure that specifies the location and size of the drawn image.</param>
290 System.Drawing.Image image,
295 /// Draws an ellipse defined by a bounding RectangleF.
297 /// <param name="pen">Pen object that determines the color, width, and style of the ellipse.</param>
298 /// <param name="rect">RectangleF structure that defines the boundaries of the ellipse.</param>
305 /// Draws a series of line segments that connect an array of PointF structures.
307 /// <param name="pen">Pen object that determines the color, width, and style of the line segments.</param>
308 /// <param name="points">Array of PointF structures that represent the points to connect.</param>
314 #endregion // Drawing Methods
316 #region Filling Methods
319 /// Fills the interior of an ellipse defined by a bounding rectangle
320 /// specified by a RectangleF structure.
322 /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
323 /// <param name="rect">RectangleF structure that represents the bounding rectangle that defines the ellipse.</param>
330 /// Fills the interior of a GraphicsPath object.
332 /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
333 /// <param name="path">GraphicsPath object that represents the path to fill.</param>
340 /// Fills the interior of a Region object.
342 /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
343 /// <param name="region">Region object that represents the area to fill.</param>
350 /// Fills the interior of a rectangle specified by a RectangleF structure.
352 /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
353 /// <param name="rect">RectangleF structure that represents the rectangle to fill.</param>
360 /// Fills the interior of a rectangle specified by a pair of coordinates, a width, and a height.
362 /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
363 /// <param name="x">x-coordinate of the upper-left corner of the rectangle to fill.</param>
364 /// <param name="y">y-coordinate of the upper-left corner of the rectangle to fill.</param>
365 /// <param name="width">Width of the rectangle to fill.</param>
366 /// <param name="height">Height of the rectangle to fill.</param>
376 /// Fills the interior of a polygon defined by an array of points specified by PointF structures .
378 /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
379 /// <param name="points">Array of PointF structures that represent the vertices of the polygon to fill.</param>
386 /// Fills the interior of a pie section defined by an ellipse
387 /// specified by a pair of coordinates, a width, and a height
388 /// and two radial lines.
390 /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
391 /// <param name="x">x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie section comes.</param>
392 /// <param name="y">y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie section comes.</param>
393 /// <param name="width">Width of the bounding rectangle that defines the ellipse from which the pie section comes.</param>
394 /// <param name="height">Height of the bounding rectangle that defines the ellipse from which the pie section comes.</param>
395 /// <param name="startAngle">Angle in degrees measured clockwise from the x-axis to the first side of the pie section.</param>
396 /// <param name="sweepAngle">Angle in degrees measured clockwise from the startAngle parameter to the second side of the pie section.</param>
407 #endregion // Filling Methods
409 #region Other Methods
412 /// Measures the specified string when drawn with the specified
413 /// Font object and formatted with the specified StringFormat object.
415 /// <param name="text">String to measure.</param>
416 /// <param name="font">Font object defines the text format of the string.</param>
417 /// <param name="layoutArea">SizeF structure that specifies the maximum layout area for the text.</param>
418 /// <param name="stringFormat">StringFormat object that represents formatting information, such as line spacing, for the string.</param>
419 /// <returns>This method returns a SizeF structure that represents the size, in pixels, of the string specified in the text parameter as drawn with the font parameter and the stringFormat parameter.</returns>
424 StringFormat stringFormat
428 /// Measures the specified string when drawn with the specified
429 /// Font object and formatted with the specified StringFormat object.
431 /// <param name="text">String to measure.</param>
432 /// <param name="font">Font object defines the text format of the string.</param>
433 /// <returns>This method returns a SizeF structure that represents the size, in pixels, of the string specified in the text parameter as drawn with the font parameter and the stringFormat parameter.</returns>
440 /// Saves the current state of this Graphics object and identifies the saved state with a GraphicsState object.
442 /// <returns>This method returns a GraphicsState object that represents the saved state of this Graphics object.</returns>
443 GraphicsState Save();
446 /// Restores the saved state of graphics object.
448 /// <param name="gstate">State to restore.</param>
454 /// Resets the clip region of this Graphics object to an infinite region.
459 /// Sets the clipping region of this Graphics object to the rectangle specified by a RectangleF structure.
461 /// <param name="rect">RectangleF structure that represents the new clip region.</param>
467 /// Sets the clipping region of this Graphics object to the result of the
468 /// specified operation combining the current clip region and the
469 /// specified GraphicsPath object.
471 /// <param name="path">GraphicsPath object to combine.</param>
472 /// <param name="combineMode">Member of the CombineMode enumeration that specifies the combining operation to use.</param>
475 CombineMode combineMode
479 /// Prepends the specified translation to the transformation matrix of this Graphics object.
481 /// <param name="dx">x component of the translation.</param>
482 /// <param name="dy">y component of the translation.</param>
483 void TranslateTransform(
489 /// This method starts Selection mode
491 /// <param name="hRef">The location of the referenced object, expressed as a URI reference.</param>
492 /// <param name="title">Title which could be used for tooltips.</param>
493 void BeginSelection( string hRef, string title );
496 /// This method stops Selection mode
498 void EndSelection( );
500 #endregion // Other Methods
505 /// Gets or sets the world transformation for this Graphics object.
507 Matrix Transform {get; set;}
510 /// Gets or sets the rendering quality for this Graphics object.
512 SmoothingMode SmoothingMode {get; set;}
515 /// Gets or sets the rendering mode for text associated with this Graphics object.
517 TextRenderingHint TextRenderingHint {get; set;}
520 /// Gets or sets a Region object that limits the drawing region of this Graphics object.
522 Region Clip {get; set;}
525 /// Reference to the Graphics object
527 Graphics Graphics {get; set;}
530 /// Gets a value indicating whether the clipping region of this Graphics object is empty.
532 bool IsClipEmpty {get;}
534 #endregion // Properties