GdiGraphics.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT license.
  3. // See the LICENSE file in the project root for more information.
  4. //
  5. // Purpose: GdiGraphics class is chart GDI+ rendering engine. It
  6. // implements IChartRenderingEngine interface by mapping
  7. // its methods to the drawing methods of GDI+. This
  8. // rendering engine do not support animation.
  9. //
  10. using System.Diagnostics.CodeAnalysis;
  11. using System.Drawing;
  12. using System.Drawing.Drawing2D;
  13. using System.Drawing.Imaging;
  14. using System.Drawing.Text;
  15. namespace FastReport.DataVisualization.Charting
  16. {
  17. /// <summary>
  18. /// GdiGraphics class is chart GDI+ rendering engine.
  19. /// </summary>
  20. [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Gdi")]
  21. internal class GdiGraphics : IChartRenderingEngine
  22. {
  23. #region Constructors
  24. /// <summary>
  25. /// Default constructor
  26. /// </summary>
  27. public GdiGraphics()
  28. {
  29. }
  30. #endregion // Constructor
  31. #region Drawing Methods
  32. /// <summary>
  33. /// Draws a line connecting two PointF structures.
  34. /// </summary>
  35. /// <param name="pen">Pen object that determines the color, width, and style of the line.</param>
  36. /// <param name="pt1">PointF structure that represents the first point to connect.</param>
  37. /// <param name="pt2">PointF structure that represents the second point to connect.</param>
  38. public void DrawLine(
  39. Pen pen,
  40. PointF pt1,
  41. PointF pt2
  42. )
  43. {
  44. _graphics.DrawLine( pen, pt1, pt2 );
  45. }
  46. /// <summary>
  47. /// Draws a line connecting the two points specified by coordinate pairs.
  48. /// </summary>
  49. /// <param name="pen">Pen object that determines the color, width, and style of the line.</param>
  50. /// <param name="x1">x-coordinate of the first point.</param>
  51. /// <param name="y1">y-coordinate of the first point.</param>
  52. /// <param name="x2">x-coordinate of the second point.</param>
  53. /// <param name="y2">y-coordinate of the second point.</param>
  54. public void DrawLine(
  55. Pen pen,
  56. float x1,
  57. float y1,
  58. float x2,
  59. float y2
  60. )
  61. {
  62. _graphics.DrawLine( pen, x1, y1, x2, y2 );
  63. }
  64. /// <summary>
  65. /// Draws the specified portion of the specified Image object at the specified location and with the specified size.
  66. /// </summary>
  67. /// <param name="image">Image object to draw.</param>
  68. /// <param name="destRect">Rectangle structure that specifies the location and size of the drawn image. The image is scaled to fit the rectangle.</param>
  69. /// <param name="srcX">x-coordinate of the upper-left corner of the portion of the source image to draw.</param>
  70. /// <param name="srcY">y-coordinate of the upper-left corner of the portion of the source image to draw.</param>
  71. /// <param name="srcWidth">Width of the portion of the source image to draw.</param>
  72. /// <param name="srcHeight">Height of the portion of the source image to draw.</param>
  73. /// <param name="srcUnit">Member of the GraphicsUnit enumeration that specifies the units of measure used to determine the source rectangle.</param>
  74. /// <param name="imageAttr">ImageAttributes object that specifies recoloring and gamma information for the image object.</param>
  75. public void DrawImage(
  76. System.Drawing.Image image,
  77. Rectangle destRect,
  78. int srcX,
  79. int srcY,
  80. int srcWidth,
  81. int srcHeight,
  82. GraphicsUnit srcUnit,
  83. ImageAttributes imageAttr
  84. )
  85. {
  86. _graphics.DrawImage(
  87. image,
  88. destRect,
  89. srcX,
  90. srcY,
  91. srcWidth,
  92. srcHeight,
  93. srcUnit,
  94. imageAttr
  95. );
  96. }
  97. /// <summary>
  98. /// Draws an ellipse defined by a bounding rectangle specified by
  99. /// a pair of coordinates: a height, and a width.
  100. /// </summary>
  101. /// <param name="pen">Pen object that determines the color, width, and style of the ellipse.</param>
  102. /// <param name="x">x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.</param>
  103. /// <param name="y">y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.</param>
  104. /// <param name="width">Width of the bounding rectangle that defines the ellipse.</param>
  105. /// <param name="height">Height of the bounding rectangle that defines the ellipse.</param>
  106. public void DrawEllipse(
  107. Pen pen,
  108. float x,
  109. float y,
  110. float width,
  111. float height
  112. )
  113. {
  114. _graphics.DrawEllipse( pen, x, y, width, height );
  115. }
  116. /// <summary>
  117. /// Draws a cardinal spline through a specified array of PointF structures
  118. /// using a specified tension. The drawing begins offset from
  119. /// the beginning of the array.
  120. /// </summary>
  121. /// <param name="pen">Pen object that determines the color, width, and height of the curve.</param>
  122. /// <param name="points">Array of PointF structures that define the spline.</param>
  123. /// <param name="offset">Offset from the first element in the array of the points parameter to the starting point in the curve.</param>
  124. /// <param name="numberOfSegments">Number of segments after the starting point to include in the curve.</param>
  125. /// <param name="tension">Value greater than or equal to 0.0F that specifies the tension of the curve.</param>
  126. public void DrawCurve(
  127. Pen pen,
  128. PointF[] points,
  129. int offset,
  130. int numberOfSegments,
  131. float tension
  132. )
  133. {
  134. _graphics.DrawCurve( pen, points, offset, numberOfSegments, tension );
  135. }
  136. /// <summary>
  137. /// Draws a rectangle specified by a coordinate pair: a width, and a height.
  138. /// </summary>
  139. /// <param name="pen">Pen object that determines the color, width, and style of the rectangle.</param>
  140. /// <param name="x">x-coordinate of the upper-left corner of the rectangle to draw.</param>
  141. /// <param name="y">y-coordinate of the upper-left corner of the rectangle to draw.</param>
  142. /// <param name="width">Width of the rectangle to draw.</param>
  143. /// <param name="height">Height of the rectangle to draw.</param>
  144. public void DrawRectangle(
  145. Pen pen,
  146. int x,
  147. int y,
  148. int width,
  149. int height
  150. )
  151. {
  152. _graphics.DrawRectangle( pen, x, y, width, height );
  153. }
  154. /// <summary>
  155. /// Draws a polygon defined by an array of PointF structures.
  156. /// </summary>
  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>
  159. public void DrawPolygon(
  160. Pen pen,
  161. PointF[] points
  162. )
  163. {
  164. _graphics.DrawPolygon( pen, points );
  165. }
  166. /// <summary>
  167. /// 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.
  168. /// </summary>
  169. /// <param name="s">String to draw.</param>
  170. /// <param name="font">Font object that defines the text format of the string.</param>
  171. /// <param name="brush">Brush object that determines the color and texture of the drawn text.</param>
  172. /// <param name="layoutRectangle">RectangleF structure that specifies the location of the drawn text.</param>
  173. /// <param name="format">StringFormat object that specifies formatting properties, such as line spacing and alignment, that are applied to the drawn text.</param>
  174. public void DrawString(
  175. string s,
  176. Font font,
  177. Brush brush,
  178. RectangleF layoutRectangle,
  179. StringFormat format
  180. )
  181. {
  182. _graphics.DrawString( s, font, brush, layoutRectangle, format );
  183. }
  184. /// <summary>
  185. /// 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.
  186. /// </summary>
  187. /// <param name="s">String to draw.</param>
  188. /// <param name="font">Font object that defines the text format of the string.</param>
  189. /// <param name="brush">Brush object that determines the color and texture of the drawn text.</param>
  190. /// <param name="point">PointF structure that specifies the upper-left corner of the drawn text.</param>
  191. /// <param name="format">StringFormat object that specifies formatting properties, such as line spacing and alignment, that are applied to the drawn text.</param>
  192. public void DrawString(
  193. string s,
  194. Font font,
  195. Brush brush,
  196. PointF point,
  197. StringFormat format
  198. )
  199. {
  200. _graphics.DrawString( s, font, brush, point, format );
  201. }
  202. /// <summary>
  203. /// Draws the specified portion of the specified Image object at the specified location and with the specified size.
  204. /// </summary>
  205. /// <param name="image">Image object to draw.</param>
  206. /// <param name="destRect">Rectangle structure that specifies the location and size of the drawn image. The image is scaled to fit the rectangle.</param>
  207. /// <param name="srcX">x-coordinate of the upper-left corner of the portion of the source image to draw.</param>
  208. /// <param name="srcY">y-coordinate of the upper-left corner of the portion of the source image to draw.</param>
  209. /// <param name="srcWidth">Width of the portion of the source image to draw.</param>
  210. /// <param name="srcHeight">Height of the portion of the source image to draw.</param>
  211. /// <param name="srcUnit">Member of the GraphicsUnit enumeration that specifies the units of measure used to determine the source rectangle.</param>
  212. /// <param name="imageAttrs">ImageAttributes object that specifies recoloring and gamma information for the image object.</param>
  213. public void DrawImage(
  214. System.Drawing.Image image,
  215. Rectangle destRect,
  216. float srcX,
  217. float srcY,
  218. float srcWidth,
  219. float srcHeight,
  220. GraphicsUnit srcUnit,
  221. ImageAttributes imageAttrs
  222. )
  223. {
  224. _graphics.DrawImage( image, destRect, srcX, srcY, srcWidth, srcHeight, srcUnit, imageAttrs );
  225. }
  226. /// <summary>
  227. /// Draws a rectangle specified by a coordinate pair: a width, and a height.
  228. /// </summary>
  229. /// <param name="pen">A Pen object that determines the color, width, and style of the rectangle.</param>
  230. /// <param name="x">The x-coordinate of the upper-left corner of the rectangle to draw.</param>
  231. /// <param name="y">The y-coordinate of the upper-left corner of the rectangle to draw.</param>
  232. /// <param name="width">The width of the rectangle to draw.</param>
  233. /// <param name="height">The height of the rectangle to draw.</param>
  234. public void DrawRectangle(
  235. Pen pen,
  236. float x,
  237. float y,
  238. float width,
  239. float height
  240. )
  241. {
  242. _graphics.DrawRectangle( pen, x, y, width, height );
  243. }
  244. /// <summary>
  245. /// Draws a GraphicsPath object.
  246. /// </summary>
  247. /// <param name="pen">Pen object that determines the color, width, and style of the path.</param>
  248. /// <param name="path">GraphicsPath object to draw.</param>
  249. public void DrawPath(
  250. Pen pen,
  251. GraphicsPath path
  252. )
  253. {
  254. _graphics.DrawPath( pen, path );
  255. }
  256. /// <summary>
  257. /// Draws a pie shape defined by an ellipse specified by a coordinate pair: a width, a height and two radial lines.
  258. /// </summary>
  259. /// <param name="pen">Pen object that determines the color, width, and style of the pie shape.</param>
  260. /// <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>
  261. /// <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>
  262. /// <param name="width">Width of the bounding rectangle that defines the ellipse from which the pie shape comes.</param>
  263. /// <param name="height">Height of the bounding rectangle that defines the ellipse from which the pie shape comes.</param>
  264. /// <param name="startAngle">Angle measured in degrees clockwise from the x-axis to the first side of the pie shape.</param>
  265. /// <param name="sweepAngle">Angle measured in degrees clockwise from the startAngle parameter to the second side of the pie shape.</param>
  266. public void DrawPie(
  267. Pen pen,
  268. float x,
  269. float y,
  270. float width,
  271. float height,
  272. float startAngle,
  273. float sweepAngle
  274. )
  275. {
  276. _graphics.DrawPie( pen, x, y, width, height, startAngle, sweepAngle );
  277. }
  278. /// <summary>
  279. /// Draws an arc representing a portion of an ellipse specified by a pair of coordinates: a width, and a height.
  280. /// </summary>
  281. /// <param name="pen">Pen object that determines the color, width, and style of the arc.</param>
  282. /// <param name="x">x-coordinate of the upper-left corner of the rectangle that defines the ellipse.</param>
  283. /// <param name="y">y-coordinate of the upper-left corner of the rectangle that defines the ellipse.</param>
  284. /// <param name="width">Width of the rectangle that defines the ellipse.</param>
  285. /// <param name="height">Height of the rectangle that defines the ellipse.</param>
  286. /// <param name="startAngle">Angle in degrees measured clockwise from the x-axis to the starting point of the arc.</param>
  287. /// <param name="sweepAngle">Angle in degrees measured clockwise from the startAngle parameter to ending point of the arc.</param>
  288. public void DrawArc(
  289. Pen pen,
  290. float x,
  291. float y,
  292. float width,
  293. float height,
  294. float startAngle,
  295. float sweepAngle
  296. )
  297. {
  298. _graphics.DrawArc( pen, x, y, width, height, startAngle, sweepAngle );
  299. }
  300. /// <summary>
  301. /// Draws the specified Image object at the specified location and with the specified size.
  302. /// </summary>
  303. /// <param name="image">Image object to draw.</param>
  304. /// <param name="rect">RectangleF structure that specifies the location and size of the drawn image.</param>
  305. public void DrawImage(
  306. System.Drawing.Image image,
  307. RectangleF rect
  308. )
  309. {
  310. _graphics.DrawImage( image, rect );
  311. }
  312. /// <summary>
  313. /// Draws an ellipse defined by a bounding RectangleF.
  314. /// </summary>
  315. /// <param name="pen">Pen object that determines the color, width, and style of the ellipse.</param>
  316. /// <param name="rect">RectangleF structure that defines the boundaries of the ellipse.</param>
  317. public void DrawEllipse(
  318. Pen pen,
  319. RectangleF rect
  320. )
  321. {
  322. _graphics.DrawEllipse( pen, rect );
  323. }
  324. /// <summary>
  325. /// Draws a series of line segments that connect an array of PointF structures.
  326. /// </summary>
  327. /// <param name="pen">Pen object that determines the color, width, and style of the line segments.</param>
  328. /// <param name="points">Array of PointF structures that represent the points to connect.</param>
  329. public void DrawLines(
  330. Pen pen,
  331. PointF[] points
  332. )
  333. {
  334. _graphics.DrawLines( pen, points );
  335. }
  336. #endregion // Drawing Methods
  337. #region Filling Methods
  338. /// <summary>
  339. /// Fills the interior of an ellipse defined by a bounding rectangle
  340. /// specified by a RectangleF structure.
  341. /// </summary>
  342. /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
  343. /// <param name="rect">RectangleF structure that represents the bounding rectangle that defines the ellipse.</param>
  344. public void FillEllipse(
  345. Brush brush,
  346. RectangleF rect
  347. )
  348. {
  349. _graphics.FillEllipse( brush, rect );
  350. }
  351. /// <summary>
  352. /// Fills the interior of a GraphicsPath object.
  353. /// </summary>
  354. /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
  355. /// <param name="path">GraphicsPath object that represents the path to fill.</param>
  356. public void FillPath(
  357. Brush brush,
  358. GraphicsPath path
  359. )
  360. {
  361. _graphics.FillPath( brush, path );
  362. }
  363. /// <summary>
  364. /// Fills the interior of a Region object.
  365. /// </summary>
  366. /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
  367. /// <param name="region">Region object that represents the area to fill.</param>
  368. public void FillRegion(
  369. Brush brush,
  370. Region region
  371. )
  372. {
  373. _graphics.FillRegion( brush, region );
  374. }
  375. /// <summary>
  376. /// Fills the interior of a rectangle specified by a RectangleF structure.
  377. /// </summary>
  378. /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
  379. /// <param name="rect">RectangleF structure that represents the rectangle to fill.</param>
  380. public void FillRectangle(
  381. Brush brush,
  382. RectangleF rect
  383. )
  384. {
  385. _graphics.FillRectangle( brush, rect );
  386. }
  387. /// <summary>
  388. /// Fills the interior of a rectangle specified by a pair of coordinates, a width, and a height.
  389. /// </summary>
  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 rectangle to fill.</param>
  392. /// <param name="y">y-coordinate of the upper-left corner of the rectangle to fill.</param>
  393. /// <param name="width">Width of the rectangle to fill.</param>
  394. /// <param name="height">Height of the rectangle to fill.</param>
  395. public void FillRectangle(
  396. Brush brush,
  397. float x,
  398. float y,
  399. float width,
  400. float height
  401. )
  402. {
  403. _graphics.FillRectangle( brush, x, y, width, height );
  404. }
  405. /// <summary>
  406. /// Fills the interior of a polygon defined by an array of points specified by PointF structures .
  407. /// </summary>
  408. /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
  409. /// <param name="points">Array of PointF structures that represent the vertices of the polygon to fill.</param>
  410. public void FillPolygon(
  411. Brush brush,
  412. PointF[] points
  413. )
  414. {
  415. _graphics.FillPolygon( brush, points );
  416. }
  417. /// <summary>
  418. /// Fills the interior of a pie section defined by an ellipse
  419. /// specified by a pair of coordinates, a width, and a height
  420. /// and two radial lines.
  421. /// </summary>
  422. /// <param name="brush">Brush object that determines the characteristics of the fill.</param>
  423. /// <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>
  424. /// <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>
  425. /// <param name="width">Width of the bounding rectangle that defines the ellipse from which the pie section comes.</param>
  426. /// <param name="height">Height of the bounding rectangle that defines the ellipse from which the pie section comes.</param>
  427. /// <param name="startAngle">Angle in degrees measured clockwise from the x-axis to the first side of the pie section.</param>
  428. /// <param name="sweepAngle">Angle in degrees measured clockwise from the startAngle parameter to the second side of the pie section.</param>
  429. public void FillPie(
  430. Brush brush,
  431. float x,
  432. float y,
  433. float width,
  434. float height,
  435. float startAngle,
  436. float sweepAngle
  437. )
  438. {
  439. _graphics.FillPie( brush, x, y, width, height, startAngle, sweepAngle );
  440. }
  441. #endregion // Filling Methods
  442. #region Other Methods
  443. /// <summary>
  444. /// Measures the specified string when drawn with the specified
  445. /// Font object and formatted with the specified StringFormat object.
  446. /// </summary>
  447. /// <param name="text">String to measure.</param>
  448. /// <param name="font">Font object defines the text format of the string.</param>
  449. /// <param name="layoutArea">SizeF structure that specifies the maximum layout area for the text.</param>
  450. /// <param name="stringFormat">StringFormat object that represents formatting information, such as line spacing, for the string.</param>
  451. /// <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>
  452. public SizeF MeasureString(
  453. string text,
  454. Font font,
  455. SizeF layoutArea,
  456. StringFormat stringFormat
  457. )
  458. {
  459. return _graphics.MeasureString( text, font, layoutArea, stringFormat );
  460. }
  461. /// <summary>
  462. /// Measures the specified string when drawn with the specified
  463. /// Font object and formatted with the specified StringFormat object.
  464. /// </summary>
  465. /// <param name="text">String to measure.</param>
  466. /// <param name="font">Font object defines the text format of the string.</param>
  467. /// <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>
  468. public SizeF MeasureString(
  469. string text,
  470. Font font
  471. )
  472. {
  473. return _graphics.MeasureString( text, font );
  474. }
  475. /// <summary>
  476. /// Saves the current state of this Graphics object and identifies the saved state with a GraphicsState object.
  477. /// </summary>
  478. /// <returns>This method returns a GraphicsState object that represents the saved state of this Graphics object.</returns>
  479. public IGraphicsState Save()
  480. {
  481. return _graphics.Save();
  482. }
  483. /// <summary>
  484. /// Restores the state of this Graphics object to the state represented by a GraphicsState object.
  485. /// </summary>
  486. /// <param name="gstate">GraphicsState object that represents the state to which to restore this Graphics object.</param>
  487. public void Restore(
  488. IGraphicsState gstate
  489. )
  490. {
  491. _graphics.Restore( gstate );
  492. }
  493. /// <summary>
  494. /// Resets the clip region of this Graphics object to an infinite region.
  495. /// </summary>
  496. public void ResetClip()
  497. {
  498. _graphics.ResetClip();
  499. }
  500. /// <summary>
  501. /// Sets the clipping region of this Graphics object to the rectangle specified by a RectangleF structure.
  502. /// </summary>
  503. /// <param name="rect">RectangleF structure that represents the new clip region.</param>
  504. public void SetClip(
  505. RectangleF rect
  506. )
  507. {
  508. _graphics.SetClip( rect );
  509. }
  510. /// <summary>
  511. /// Sets the clipping region of this Graphics object to the result of the
  512. /// specified operation combining the current clip region and the
  513. /// specified GraphicsPath object.
  514. /// </summary>
  515. /// <param name="path">GraphicsPath object to combine.</param>
  516. /// <param name="combineMode">Member of the CombineMode enumeration that specifies the combining operation to use.</param>
  517. public void SetClip(
  518. GraphicsPath path,
  519. CombineMode combineMode
  520. )
  521. {
  522. _graphics.SetClip( path, combineMode );
  523. }
  524. /// <summary>
  525. /// Prepends the specified translation to the transformation matrix of this Graphics object.
  526. /// </summary>
  527. /// <param name="dx">x component of the translation.</param>
  528. /// <param name="dy">y component of the translation.</param>
  529. public void TranslateTransform(
  530. float dx,
  531. float dy
  532. )
  533. {
  534. _graphics.TranslateTransform( dx, dy );
  535. }
  536. /// <summary>
  537. /// This method starts Selection mode
  538. /// </summary>
  539. /// <param name="hRef">The location of the referenced object, expressed as a URI reference.</param>
  540. /// <param name="title">Title which could be used for tooltips.</param>
  541. public void BeginSelection( string hRef, string title )
  542. {
  543. // Not supported for GDI+
  544. }
  545. /// <summary>
  546. /// This method stops Selection mode
  547. /// </summary>
  548. public void EndSelection( )
  549. {
  550. // Not supported for GDI+
  551. }
  552. #endregion // Other Methods
  553. #region Properties
  554. /// <summary>
  555. /// Gets or sets the world transformation for this Graphics object.
  556. /// </summary>
  557. public Matrix Transform
  558. {
  559. get
  560. {
  561. return _graphics.Transform;
  562. }
  563. set
  564. {
  565. _graphics.Transform = value;
  566. }
  567. }
  568. /// <summary>
  569. /// Gets or sets the rendering quality for this Graphics object.
  570. /// </summary>
  571. public SmoothingMode SmoothingMode
  572. {
  573. get
  574. {
  575. return _graphics.SmoothingMode;
  576. }
  577. set
  578. {
  579. _graphics.SmoothingMode = value;
  580. }
  581. }
  582. /// <summary>
  583. /// Gets or sets the rendering mode for text associated with this Graphics object.
  584. /// </summary>
  585. public TextRenderingHint TextRenderingHint
  586. {
  587. get
  588. {
  589. return _graphics.TextRenderingHint;
  590. }
  591. set
  592. {
  593. _graphics.TextRenderingHint = value;
  594. }
  595. }
  596. /// <summary>
  597. /// Gets or sets a Region object that limits the drawing region of this Graphics object.
  598. /// </summary>
  599. public Region Clip
  600. {
  601. get
  602. {
  603. return _graphics.Clip;
  604. }
  605. set
  606. {
  607. _graphics.Clip = value;
  608. }
  609. }
  610. /// <summary>
  611. /// Gets a value indicating whether the clipping region of this Graphics object is empty.
  612. /// </summary>
  613. public bool IsClipEmpty
  614. {
  615. get
  616. {
  617. return _graphics.IsClipEmpty;
  618. }
  619. }
  620. /// <summary>
  621. /// Reference to the Graphics object
  622. /// </summary>
  623. public IGraphics Graphics
  624. {
  625. get
  626. {
  627. return _graphics;
  628. }
  629. set
  630. {
  631. _graphics = value;
  632. }
  633. }
  634. #endregion // Properties
  635. #region Fields
  636. /// <summary>
  637. /// Graphics object
  638. /// </summary>
  639. IGraphics _graphics = null;
  640. #endregion // Fields
  641. }
  642. }