2 // Test.System.Drawing.Graphics.cs
\r
5 // Konstantin Triger <kostat@mainsoft.com>
\r
9 // Copyright (C) 2005 Mainsoft, Corp (http://www.mainsoft.com)
\r
11 // Permission is hereby granted, free of charge, to any person obtaining
\r
12 // a copy of this software and associated documentation files (the
\r
13 // "Software"), to deal in the Software without restriction, including
\r
14 // without limitation the rights to use, copy, modify, merge, publish,
\r
15 // distribute, sublicense, and/or sell copies of the Software, and to
\r
16 // permit persons to whom the Software is furnished to do so, subject to
\r
17 // the following conditions:
\r
19 // The above copyright notice and this permission notice shall be
\r
20 // included in all copies or substantial portions of the Software.
\r
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
\r
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
\r
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
\r
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
\r
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
\r
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
\r
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\r
32 using System.Collections;
\r
33 using System.Diagnostics;
\r
34 using NUnit.Framework;
\r
35 using System.Drawing;
\r
36 using System.Drawing.Drawing2D;
\r
37 using System.Drawing.Text;
\r
38 using System.Drawing.Imaging;
\r
39 using DrawingTestHelper;
\r
42 namespace Test.Sys.Drawing.GraphicsFixtures {
\r
43 #region GraphicsFixtureProps
\r
46 public class GraphicsFixtureProps {
\r
48 protected DrawingTest t;
\r
49 const int TOLERANCE = 3; //in %
\r
52 public void SetUp() {
\r
53 t = DrawingTest.Create(512, 512);
\r
57 public void TearDown ()
\r
64 public void ClipTest_1() {
\r
65 Region r = new Region();
\r
66 Assert.IsTrue(r.Equals(t.Graphics.Clip, t.Graphics));
\r
70 public void ClipTest_2() {
\r
71 Region r = new Region(new Rectangle(10, 10, 60, 60));
\r
72 t.Graphics.Clip = r;
\r
73 Assert.IsTrue(r.Equals(t.Graphics.Clip, t.Graphics));
\r
75 Pen redPen = new Pen(Color.Red, 3);
\r
76 Pen greenPen = new Pen(Color.Green, 3);
\r
77 // Create points that define curve.
\r
78 Point point1 = new Point( 50, 50);
\r
79 Point point2 = new Point(100, 25);
\r
80 Point point3 = new Point(200, 5);
\r
81 Point point4 = new Point(250, 50);
\r
82 Point point5 = new Point(300, 100);
\r
83 Point point6 = new Point(350, 200);
\r
84 Point point7 = new Point(250, 250);
\r
85 Point[] curvePoints = {
\r
94 // Draw lines between original points to screen.
\r
95 t.Graphics.DrawLines(redPen, curvePoints);
\r
97 Assert.IsTrue(t.PDCompare(TOLERANCE));
\r
101 public void ClipTest_3() {
\r
102 t.Graphics.TranslateTransform(3, 3);
\r
103 t.Graphics.SetClip(new Rectangle(23, 24, 30, 40));
\r
105 RectangleF cb = t.Graphics.VisibleClipBounds;
\r
106 DrawingTest.AssertAlmostEqual(23, cb.X);
\r
107 DrawingTest.AssertAlmostEqual(24, cb.Y);
\r
108 DrawingTest.AssertAlmostEqual(30, cb.Width);
\r
109 DrawingTest.AssertAlmostEqual(40, cb.Height);
\r
111 t.Graphics.PageUnit = GraphicsUnit.Millimeter;
\r
113 t.Graphics.RotateTransform(128);
\r
115 t.Graphics.TranslateTransform(14, 14);
\r
116 t.Graphics.ExcludeClip(new Rectangle(0, 0, 4, 60));
\r
119 t.Graphics.RotateTransform(128);
\r
121 t.Graphics.PageUnit = GraphicsUnit.Pixel;
\r
123 t.Graphics.TranslateClip(5.2f, 3.1f);
\r
125 t.Graphics.ResetTransform();
\r
126 t.Graphics.PageUnit = GraphicsUnit.Pixel;
\r
128 cb = t.Graphics.VisibleClipBounds;
\r
129 DrawingTest.AssertAlmostEqual(28, cb.X);
\r
130 DrawingTest.AssertAlmostEqual(22, cb.Y);
\r
131 DrawingTest.AssertAlmostEqual(30, cb.Width);
\r
132 DrawingTest.AssertAlmostEqual(40, cb.Height);
\r
134 t.Graphics.ScaleTransform(5, 7);
\r
135 t.Graphics.IntersectClip(new Rectangle(7, 4, 20, 20));
\r
137 cb = t.Graphics.VisibleClipBounds;
\r
138 DrawingTest.AssertAlmostEqual(7, cb.X);
\r
139 DrawingTest.AssertAlmostEqual(4f, cb.Y);
\r
140 DrawingTest.AssertAlmostEqual(4.6f, cb.Width);
\r
141 DrawingTest.AssertAlmostEqual(4.85714245f, cb.Height);
\r
145 public void ClipBoundsTest() {
\r
146 Region r = new Region();
\r
147 Assert.IsTrue(t.Graphics.ClipBounds.Equals(r.GetBounds(t.Graphics)));
\r
149 RectangleF rf = new RectangleF(10, 10, 60, 60);
\r
150 r = new Region(rf);
\r
151 t.Graphics.Clip = r;
\r
152 Assert.IsTrue(rf.Equals(t.Graphics.ClipBounds));
\r
156 public void CompositingModeTest() {
\r
157 //TODO: seems to draw equal images
\r
158 Assert.AreEqual(CompositingMode.SourceOver, t.Graphics.CompositingMode);
\r
160 Bitmap b = new Bitmap(100, 100);
\r
161 Graphics g = Graphics.FromImage(b);
\r
163 Color c = Color.FromArgb(100, Color.Red);
\r
165 Brush redBrush = new SolidBrush(c);
\r
166 g.FillEllipse(redBrush, 5, 6, 100, 200);
\r
167 //t.Graphics.FillEllipse(redBrush, 5, 6, 100, 200);
\r
168 t.Graphics.DrawImage(b, 10, 10);
\r
172 t.Graphics.CompositingMode = CompositingMode.SourceCopy;
\r
174 t.Graphics.DrawImage(b, 300, 300);
\r
177 Assert.IsTrue(t.PDCompare(TOLERANCE));
\r
181 public void CompositingQualityTest() {
\r
185 public void DpiXTest() {
\r
186 Assert.IsTrue(t.Graphics.DpiX == 96f);
\r
190 public void DpiYTest() {
\r
191 Assert.IsTrue(t.Graphics.DpiY == 96f);
\r
195 public void InterpolationModeTest() {
\r
196 Assert.AreEqual(InterpolationMode.Bilinear, t.Graphics.InterpolationMode);
\r
200 public void IsClipEmtpyTest() {
\r
201 Assert.IsFalse(t.Graphics.IsClipEmpty);
\r
204 t.Graphics.Clip = null;
\r
205 Assert.Fail("The ArgumentNullException was not thrown");
\r
207 catch(Exception e) {
\r
208 Assert.AreEqual(e.GetType(), typeof(ArgumentNullException));
\r
211 Region r = new Region(new Rectangle(10, 10, 0, 0));
\r
212 t.Graphics.Clip = r;
\r
214 Assert.IsTrue( t.Graphics.IsClipEmpty);
\r
218 public void IsVisibleClipEmtpyTest() {
\r
219 Assert.IsFalse(t.Graphics.IsVisibleClipEmpty, "default t.Graphics.IsVisibleClipEmpty");
\r
221 Region r = new Region(new Rectangle(512, 512, 100, 100));
\r
222 t.Graphics.Clip = r;
\r
223 Assert.IsFalse(t.Graphics.IsClipEmpty);
\r
224 Assert.IsTrue(t.Graphics.IsVisibleClipEmpty);
\r
228 public void PageScaleTest() {
\r
229 Assert.AreEqual(1f, t.Graphics.PageScale);
\r
233 public void PageUnitTest() {
\r
234 Assert.AreEqual(GraphicsUnit.Display, t.Graphics.PageUnit);
\r
238 public void PixelOffsetModeTest() {
\r
239 Assert.AreEqual(PixelOffsetMode.Default, t.Graphics.PixelOffsetMode);
\r
243 [Category("NotWorking")]
\r
244 public void RenderingOriginTest() {
\r
245 Assert.AreEqual(new Point(0,0), t.Graphics.RenderingOrigin);
\r
249 public void SmoothingModeTest() {
\r
250 Assert.AreEqual(SmoothingMode.None, t.Graphics.SmoothingMode);
\r
254 public void TextContrastTest() {
\r
255 Assert.AreEqual(4, t.Graphics.TextContrast);
\r
259 public void TextRenderingHintTest() {
\r
260 Assert.AreEqual(TextRenderingHint.SystemDefault, t.Graphics.TextRenderingHint);
\r
264 public void TransformTest() {
\r
265 Assert.AreEqual(new Matrix(), t.Graphics.Transform);
\r
269 public void VisibleClipBoundsTest() {
\r
270 Assert.AreEqual(new RectangleF(0, 0, 512, 512), t.Graphics.VisibleClipBounds);
\r
278 public class DrawImage {
\r
279 protected DrawingTest t;
\r
280 protected int TOLERANCE = 10; //in %;
\r
281 protected Hashtable st = new Hashtable();
\r
283 Rectangle src = new Rectangle(0, 0, 50, 50);
\r
284 RectangleF srcF = new Rectangle(0, 0, 50, 50);
\r
285 Rectangle dst = new Rectangle(170, 170, 100, 100);
\r
286 RectangleF dstF = new Rectangle(270, 270, 100, 100);
\r
292 public virtual void SetUp() {
\r
293 SetUp("DrawImage");
\r
294 DrawingTest.ShowForms = false;
\r
296 bmp = Bitmap.FromFile("bitmap50.png");
\r
297 bmp2 = Bitmap.FromFile("bitmap25.png");
\r
299 catch(Exception e) {
\r
300 Console.WriteLine(e.Message);
\r
303 public virtual void SetUp(string ownerClass) {
\r
304 t = DrawingTest.Create(512, 512, ownerClass);
\r
305 t.Graphics.InterpolationMode = InterpolationMode.NearestNeighbor;
\r
307 // hashtable of differents tolerance values for specified tests.
\r
310 public void TearDown() {
\r
316 public void DrawImage1() {
\r
317 t.Graphics.DrawImage(bmp, new Point[]{new Point(170,10), new Point(250,0), new Point(100,100)}, src, GraphicsUnit.Pixel );
\r
318 t.Graphics.DrawImage(bmp, new PointF[]{new PointF(70,10), new PointF(150,0), new PointF(10,100)}, srcF, GraphicsUnit.Pixel );
\r
320 Assert.IsTrue(t.Compare());
\r
323 public void DrawImage2() {
\r
324 t.Graphics.DrawImage(bmp, dst, src, GraphicsUnit.Pixel);
\r
325 t.Graphics.DrawImage(bmp, dstF, srcF, GraphicsUnit.Pixel);
\r
327 Assert.IsTrue(t.Compare());
\r
330 public void DrawImage3() {
\r
331 t.Graphics.DrawImage(bmp, 10.0F, 10.0F, srcF, GraphicsUnit.Pixel);
\r
332 t.Graphics.DrawImage(bmp, 70.0F, 150.0F, 250.0F, 150.0F);
\r
334 Assert.IsTrue(t.Compare());
\r
337 public void DrawImage4() {
\r
338 t.Graphics.DrawImage(bmp, dst);
\r
339 t.Graphics.DrawImage(bmp, dstF);
\r
341 Assert.IsTrue(t.Compare());
\r
344 public void DrawImage5() {
\r
345 t.Graphics.SetClip( new Rectangle(70, 0, 20, 200));
\r
346 t.Graphics.DrawImage(bmp, new Point[]{new Point(50,50), new Point(250,30), new Point(100,150)}, src, GraphicsUnit.Pixel );
\r
348 Assert.IsTrue(t.Compare());
\r
351 public void DrawImage6() {
\r
352 t.Graphics.ScaleTransform(2, 2);
\r
353 t.Graphics.SetClip( new Rectangle(70, 0, 20, 200));
\r
354 t.Graphics.DrawImage(bmp, new Point[]{new Point(50,50), new Point(250,30), new Point(100,150)}, src, GraphicsUnit.Pixel );
\r
356 Assert.IsTrue(t.Compare());
\r
359 public void DrawImage7() {
\r
360 t.Graphics.DrawImage(bmp, 170, 70, src, GraphicsUnit.Pixel);
\r
361 t.Graphics.DrawImage(bmp, 70, 350, 350, 150);
\r
363 Assert.IsTrue(t.Compare());
\r
366 public void DrawImage8() {
\r
367 t.Graphics.DrawImage(bmp, new Point[]{new Point(170,10), new Point(250,10), new Point(100,100)} );
\r
368 t.Graphics.DrawImage(bmp, new PointF[]{new PointF(170,100), new PointF(250,100), new PointF(100,190)} );
\r
370 Assert.IsTrue(t.Compare());
\r
373 public void DrawImage9() {
\r
374 t.Graphics.DrawImage(bmp, 0, 0);
\r
375 t.Graphics.DrawImage(bmp, 200, 200);
\r
377 Assert.IsTrue(t.Compare());
\r
380 public void DrawImagePageUnit() {
\r
381 t.Graphics.PageUnit = GraphicsUnit.Document;
\r
382 Point [] p = new Point[]{
\r
383 new Point(100, 100),
\r
384 new Point(200, 100),
\r
388 t.Graphics.DrawImage(bmp2, p, new Rectangle(100, 100, 100, 100), GraphicsUnit.Pixel);
\r
390 Assert.IsTrue(t.Compare());
\r
393 public void DrawImagePageUnit_2() {
\r
394 t.Graphics.PageUnit = GraphicsUnit.Millimeter;
\r
395 t.Graphics.ScaleTransform(0.3f, 0.3f);
\r
396 Point [] p = new Point[]{
\r
397 new Point(100, 100),
\r
398 new Point(200, 100),
\r
402 t.Graphics.DrawImage(bmp2, p, new Rectangle(100, 100, 100, 100), GraphicsUnit.Pixel);
\r
404 Assert.IsTrue(t.Compare());
\r
407 public void DrawImagePageUnit_3() {
\r
408 t.Graphics.PageUnit = GraphicsUnit.Millimeter;
\r
409 t.Graphics.ScaleTransform(0.3f, 0.3f);
\r
410 t.Graphics.DrawImage(bmp2, new Rectangle(100, 100, 100, 100));
\r
412 Assert.IsTrue(t.Compare());
\r
415 public void DrawImagePageUnit_4() {
\r
416 t.Graphics.PageUnit = GraphicsUnit.Millimeter;
\r
417 t.Graphics.ScaleTransform(0.5f, 0.5f);
\r
418 t.Graphics.DrawImage(bmp, 50, 50);
\r
420 Assert.IsTrue(t.Compare());
\r
423 public void DrawImagePageUnitClip() {
\r
424 t.Graphics.PageUnit = GraphicsUnit.Millimeter;
\r
425 t.Graphics.ScaleTransform(0.3f, 0.3f);
\r
426 Point [] p = new Point[]{
\r
427 new Point(100, 100),
\r
428 new Point(200, 100),
\r
432 t.Graphics.SetClip( new Rectangle(120, 120, 50, 100) );
\r
433 t.Graphics.DrawImage(bmp2, p, new Rectangle(100, 100, 100, 100), GraphicsUnit.Pixel);
\r
435 Assert.IsTrue(t.Compare());
\r
439 [Category("NotWorking")] // defect 6145
\r
441 public void DrawImageWithResolution() {
\r
442 t.Graphics.DrawImage(bmp2, 0, 0);
\r
444 Assert.IsTrue(t.Compare());
\r
447 public void DrawImageInContainer1() {
\r
448 t.Graphics.BeginContainer(new Rectangle(10, 10, 50, 50), new Rectangle(70, 70, 100, 100), GraphicsUnit.Pixel);
\r
449 t.Graphics.DrawImage(bmp, 0, 0);
\r
451 Assert.IsTrue(t.Compare());
\r
455 [Category ("NotWorking")] // defect 6145
\r
457 public void DrawImageInContainer2() {
\r
458 t.Graphics.BeginContainer(new Rectangle(10, 10, 50, 50), new Rectangle(70, 70, 100, 100), GraphicsUnit.Pixel);
\r
459 t.Graphics.DrawImage(bmp2, 0, 0);
\r
461 Assert.IsTrue(t.Compare());
\r
464 public void DrawImageInContainer3() {
\r
465 t.Graphics.BeginContainer(new Rectangle(10, 10, 50, 50), new Rectangle(70, 70, 100, 100), GraphicsUnit.Pixel);
\r
466 t.Graphics.SetClip( new Rectangle(0, 0, 15, 15) );
\r
467 t.Graphics.ScaleTransform(0.5f, 0.5f);
\r
468 t.Graphics.DrawImage(bmp2, 0, 0);
\r
470 Assert.IsTrue(t.Compare());
\r
473 public void DrawImageInContainer4() {
\r
474 Point [] p = new Point[]{
\r
475 new Point(100, 100),
\r
476 new Point(200, 100),
\r
480 t.Graphics.SetClip( new Rectangle(70, 70, 70, 70) );
\r
481 GraphicsContainer c = t.Graphics.BeginContainer( new Rectangle(20, 20, 10, 10), new Rectangle(77, 77, 7, 7), GraphicsUnit.Pixel);
\r
482 t.Graphics.DrawImage(bmp2, p, new Rectangle(100, 100, 100, 100), GraphicsUnit.Pixel);
\r
483 t.Graphics.EndContainer( c );
\r
485 Assert.IsTrue(t.Compare());
\r
490 #region GraphicsFixtureFillModes
\r
492 public class GraphicsFixtureFillModes {
\r
493 protected DrawingTest t;
\r
494 protected int TOLERANCE = 3; //in %;
\r
497 public virtual void SetUp() {
\r
498 SetUp("GraphicsFixtureFillModes");
\r
500 public virtual void SetUp(string ownerClass) {
\r
501 t = DrawingTest.Create(512, 512, ownerClass);
\r
504 public void TearDown() {
\r
510 public void FillModeAlternate() {
\r
511 GraphicsPath p = new GraphicsPath();
\r
512 Assert.AreEqual(FillMode.Alternate, p.FillMode);
\r
515 public void FillModeAlternate_1() {
\r
516 Point [] p = new Point[] {
\r
517 new Point(50, 100),
\r
519 new Point(90, 100),
\r
520 new Point(140, 10),
\r
521 new Point(150, 100),
\r
522 new Point(170, 10),
\r
526 GraphicsPath path = new GraphicsPath();
\r
527 path.AddLines( p );
\r
528 path.FillMode = FillMode.Alternate;
\r
529 t.Graphics.FillPath( Brushes.Blue, path );
\r
531 Assert.IsTrue(t.PDCompare());
\r
534 public void FillModeAlternate_2() {
\r
536 Rectangle r1 = new Rectangle(100, 100, 100, 100);
\r
537 Rectangle r2 = new Rectangle(125, 125, 50, 50);
\r
538 GraphicsPath path = new GraphicsPath();
\r
539 path.AddRectangle( r1 );
\r
540 path.AddRectangle( r2 );
\r
541 path.FillMode = FillMode.Alternate;
\r
542 t.Graphics.FillPath( Brushes.Blue, path );
\r
544 Assert.IsTrue(t.PDCompare());
\r
547 public void FillModeAlternate_3() {
\r
548 Point [] p = new Point[] {
\r
549 new Point(50, 100),
\r
550 new Point(150, 50),
\r
551 new Point(250, 100),
\r
553 new Point(250, 50),
\r
557 GraphicsPath path = new GraphicsPath();
\r
558 path.AddLines( p );
\r
559 path.FillMode = FillMode.Alternate;
\r
560 t.Graphics.FillPath( Brushes.Blue, path );
\r
562 Assert.IsTrue(t.PDCompare());
\r
565 public void FillModeWinding_1() {
\r
566 Point [] p = new Point[] {
\r
567 new Point(50, 100),
\r
569 new Point(90, 100),
\r
570 new Point(140, 10),
\r
571 new Point(150, 100),
\r
572 new Point(170, 10),
\r
576 GraphicsPath path = new GraphicsPath();
\r
577 path.AddLines( p );
\r
578 path.FillMode = FillMode.Winding;
\r
579 t.Graphics.FillPath( Brushes.Blue, path );
\r
581 Assert.IsTrue(t.PDCompare());
\r
584 public void FillModeWinding_2() {
\r
586 Rectangle r1 = new Rectangle(100, 100, 100, 100);
\r
587 Rectangle r2 = new Rectangle(125, 125, 50, 50);
\r
588 GraphicsPath path = new GraphicsPath();
\r
589 path.AddRectangle( r1 );
\r
590 path.AddRectangle( r2 );
\r
591 path.FillMode = FillMode.Winding;
\r
592 t.Graphics.FillPath( Brushes.Blue, path );
\r
594 Assert.IsTrue(t.PDCompare());
\r
597 public void FillModeWinding_3() {
\r
598 Point [] p = new Point[] {
\r
599 new Point(50, 100),
\r
600 new Point(150, 50),
\r
601 new Point(250, 100),
\r
603 new Point(250, 50),
\r
607 GraphicsPath path = new GraphicsPath();
\r
608 path.AddLines( p );
\r
609 path.FillMode = FillMode.Winding;
\r
610 t.Graphics.FillPath( Brushes.Blue, path );
\r
612 Assert.IsTrue(t.PDCompare());
\r
619 #region GraphicsFixture
\r
621 /// Summary description for Graphics.
\r
624 public class GraphicsFixture {
\r
625 protected DrawingTest t;
\r
626 protected int TOLERANCE = 3; //in %;
\r
627 protected Hashtable st = new Hashtable();
\r
630 public virtual void SetUp() {
\r
631 SetUp("GraphicsFixture");
\r
633 public virtual void SetUp(string ownerClass) {
\r
634 t = DrawingTest.Create(512, 512, ownerClass);
\r
636 // hashtable of differents tolerance values for specified tests. (for fft comparer)
\r
637 st["DrawArcTest:6"] = TOLERANCE * 2.5f;
\r
638 st["DrawCurveTestF:4"] = TOLERANCE * 2f;
\r
639 st["DrawPolygonPoint:2"] = TOLERANCE * 2f;
\r
640 st["DrawPolygonPointF:2"] = TOLERANCE * 2f;
\r
641 st["DrawStringFloatFormat:2"] = TOLERANCE * 2f; // in .net the font is shmoothed
\r
642 st["DrawStringFloatFormat:4"] = TOLERANCE * 2.5f; // in .net the font is shmoothed
\r
643 st["DrawStringFloatFormat:6"] = TOLERANCE * 2.5f; // in .net the font is shmoothed
\r
644 st["RotateTransformAngleMatrixOrder1:2"] = TOLERANCE * 2f; // Line width problem
\r
645 st["ScaleTransformFloatMatrixOrder:2"] = TOLERANCE * 2f; // Line width problem
\r
646 st["TranslateTransformAngleMatrixOrder:2"] = TOLERANCE * 2f; // Line width problem
\r
647 t.SpecialTolerance = st;
\r
651 public void TearDown ()
\r
658 public virtual void BeginContainerTest() {
\r
659 // Define transformation for container.
\r
660 RectangleF srcRect = new RectangleF(0.0F, 0.0F, 200.0F, 200.0F);
\r
661 RectangleF destRect = new RectangleF(100.0F, 100.0F, 150.0F, 150.0F);
\r
662 // Begin graphics container.
\r
663 GraphicsContainer containerState = t.Graphics.BeginContainer(
\r
665 GraphicsUnit.Pixel);
\r
666 // Fill red rectangle in container.
\r
667 t.Graphics.FillRectangle(new SolidBrush(Color.Red), 0.0F, 0.0F, 200.0F, 200.0F);
\r
669 // End graphics container.
\r
670 t.Graphics.EndContainer(containerState);
\r
671 // Fill untransformed rectangle with green.
\r
672 t.Graphics.FillRectangle(new SolidBrush(Color.Green), 0.0F, 0.0F, 200.0F, 200.0F);
\r
674 Assert.IsTrue(t.PDCompare());
\r
677 public virtual void BeginContainerTest_2() {
\r
678 t.Graphics.DrawRectangle( Pens.Black, new Rectangle(70, 70, 50, 100) );
\r
679 t.Graphics.DrawRectangle( Pens.Black, new Rectangle(50, 100, 150, 50) );
\r
680 t.Graphics.DrawRectangle( Pens.Black, new Rectangle(80, 120, 10, 10) );
\r
682 t.Graphics.SetClip( new Rectangle(70, 70, 50, 100) );
\r
683 t.Graphics.Clear( Color.Blue );
\r
685 GraphicsContainer c1 = t.Graphics.BeginContainer();
\r
686 t.Graphics.SetClip( new Rectangle(50, 100, 150, 50) );
\r
687 t.Graphics.Clear( Color.Green );
\r
689 GraphicsContainer c2 = t.Graphics.BeginContainer();
\r
690 t.Graphics.SetClip( new Rectangle(80, 120, 10, 10) );
\r
691 t.Graphics.Clear( Color.Red );
\r
693 t.Graphics.EndContainer( c2 );
\r
694 t.Graphics.FillRectangle( Brushes.Yellow, new Rectangle(100, 120, 10, 10) );
\r
695 t.Graphics.FillRectangle( Brushes.Yellow, new Rectangle(150, 120, 10, 10) );
\r
697 t.Graphics.EndContainer( c1 );
\r
698 t.Graphics.FillRectangle( Brushes.Yellow, new Rectangle(100, 80, 10, 10) );
\r
699 t.Graphics.FillRectangle( Brushes.Yellow, new Rectangle(150, 80, 10, 10) );
\r
702 Assert.IsTrue(t.PDCompare());
\r
705 public virtual void ClearTest() {
\r
706 // Clear screen with teal background.
\r
708 Assert.IsTrue(t.PDCompare());
\r
709 t.Graphics.Clear(Color.Teal);
\r
711 Assert.IsTrue(t.PDCompare());
\r
715 public virtual void DrawArcTest() {
\r
717 Pen blackPen= new Pen(Color.Black, 1);
\r
718 // Create coordinates of rectangle to bound ellipse.
\r
721 float width = 400.0F;
\r
722 float height = 100.0F;
\r
723 // Create start and sweep angles on ellipse.
\r
724 float startAngle = 370.0F;
\r
725 float sweepAngle = 70.0F;
\r
726 // Draw arc to screen.
\r
727 t.Graphics.DrawArc(blackPen, (int)x, (int)y, (int)width, (int)height, (int)startAngle, (int)sweepAngle);
\r
729 Assert.IsTrue(t.PDCompare());
\r
731 startAngle = 10.0F;
\r
732 sweepAngle = 120.0F;
\r
733 t.Graphics.DrawArc(blackPen, new Rectangle((int)x, (int)y, (int)width, (int)height), startAngle, sweepAngle);
\r
735 Assert.IsTrue(t.PDCompare());
\r
737 startAngle = 10.0F;
\r
738 sweepAngle = 190.0F;
\r
739 t.Graphics.DrawArc(blackPen, x, y, width, height, startAngle, sweepAngle);
\r
741 Assert.IsTrue(t.PDCompare());
\r
743 startAngle = 10.0F;
\r
744 sweepAngle = 300.0F;
\r
745 t.Graphics.DrawArc(blackPen, new RectangleF(x, y, width, height), startAngle, sweepAngle);
\r
747 Assert.IsTrue(t.PDCompare());
\r
749 startAngle = -179.9F;
\r
750 sweepAngle = -359.9F;
\r
751 t.Graphics.DrawArc(blackPen, new RectangleF(x, y, width, height), startAngle, sweepAngle);
\r
753 Assert.IsTrue(t.PDCompare());
\r
755 startAngle = -10.0F;
\r
756 sweepAngle = -300.0F;
\r
757 t.Graphics.DrawArc(blackPen, new RectangleF(x, y, width, height), startAngle, sweepAngle);
\r
759 Assert.IsTrue(t.PDCompare());
\r
763 public virtual void DrawBezierTest() {
\r
765 Pen blackPen = new Pen(Color.Black, 3);
\r
766 // Create coordinates of points for curve.
\r
767 float startX = 100.0F;
\r
768 float startY = 100.0F;
\r
769 float controlX1 = 200.0F;
\r
770 float controlY1 = 10.0F;
\r
771 float controlX2 = 350.0F;
\r
772 float controlY2 = 50.0F;
\r
773 float endX = 500.0F;
\r
774 float endY = 100.0F;
\r
775 // Draw arc to screen.
\r
776 t.Graphics.DrawBezier(blackPen, startX, startY,
\r
777 controlX1, controlY1,
\r
778 controlX2, controlY2,
\r
781 Assert.IsTrue(t.PDCompare());
\r
783 t.Graphics.DrawBezier(blackPen, new PointF( startX, startY),
\r
784 new PointF(controlX1, controlY1),
\r
785 new PointF(controlX2, controlY2),
\r
786 new PointF(endX, endY));
\r
788 Assert.IsTrue(t.PDCompare());
\r
790 t.Graphics.DrawBezier(blackPen, new Point((int)startX, (int)startY),
\r
791 new Point((int)controlX1, (int)controlY1),
\r
792 new Point((int)controlX2, (int)controlY2),
\r
793 new Point((int)endX, (int)endY));
\r
795 Assert.IsTrue(t.PDCompare());
\r
799 public virtual void DrawBeziersTest() {
\r
801 Pen blackPen = new Pen(Color.Black, 3);
\r
802 // Create points for curve.
\r
803 Point start = new Point(100, 100);
\r
804 Point control1 = new Point(200, 10);
\r
805 Point control2 = new Point(350, 50);
\r
806 Point end1 = new Point(500, 100);
\r
807 Point control3 = new Point(600, 150);
\r
808 Point control4 = new Point(650, 250);
\r
809 Point end2 = new Point(500, 300);
\r
810 Point[] bezierPoints = {
\r
811 start, control1, control2, end1,
\r
812 control3, control4, end2
\r
814 // Draw arc to screen.
\r
815 t.Graphics.DrawBeziers(blackPen, bezierPoints);
\r
817 Assert.IsTrue(t.PDCompare());
\r
820 PointF startF = new PointF(100.0F, 100.0F);
\r
821 PointF control1F = new PointF(200.0F, 10.0F);
\r
822 PointF control2F = new PointF(350.0F, 50.0F);
\r
823 PointF end1F = new PointF(500.0F, 100.0F);
\r
824 PointF control3F = new PointF(600.0F, 150.0F);
\r
825 PointF control4F = new PointF(650.0F, 250.0F);
\r
826 PointF end2F = new PointF(500.0F, 300.0F);
\r
827 PointF[] bezierPointsF = {
\r
828 startF, control1F, control2F, end1F,
\r
829 control3F, control4F, end2F
\r
831 // Draw arc to screen.
\r
832 t.Graphics.DrawBeziers(blackPen, bezierPointsF);
\r
834 Assert.IsTrue(t.PDCompare());
\r
838 public virtual void DrawClosedCurveTest() {
\r
840 Pen redPen = new Pen(Color.Red, 3);
\r
841 Pen greenPen = new Pen(Color.Green, 3);
\r
842 // Create points that define curve.
\r
843 PointF point1 = new PointF( 50.0F, 50.0F);
\r
844 PointF point2 = new PointF(100.0F, 25.0F);
\r
845 PointF point3 = new PointF(200.0F, 5.0F);
\r
846 PointF point4 = new PointF(250.0F, 50.0F);
\r
847 PointF point5 = new PointF(300.0F, 100.0F);
\r
848 PointF point6 = new PointF(350.0F, 200.0F);
\r
849 PointF point7 = new PointF(250.0F, 250.0F);
\r
850 PointF[] curvePoints = {
\r
859 // Draw lines between original points to screen.
\r
860 t.Graphics.DrawLines(redPen, curvePoints);
\r
861 // Create tension and fill mode.
\r
862 float tension = 0.7F;
\r
863 FillMode aFillMode = FillMode.Alternate;
\r
864 // Draw closed curve to screen.
\r
865 t.Graphics.DrawClosedCurve(greenPen, curvePoints, tension, aFillMode);
\r
867 Assert.IsTrue(t.PDCompare());
\r
870 aFillMode = FillMode.Winding;
\r
871 // Draw closed curve to screen.
\r
872 t.Graphics.DrawClosedCurve(greenPen, curvePoints, tension, aFillMode);
\r
874 Assert.IsTrue(t.PDCompare());
\r
878 public virtual void DrawCurveTest() {
\r
880 Pen redPen = new Pen(Color.Red, 3);
\r
881 Pen greenPen = new Pen(Color.Green, 3);
\r
882 // Create points that define curve.
\r
883 Point point1 = new Point( 50, 50);
\r
884 Point point2 = new Point(100, 25);
\r
885 Point point3 = new Point(200, 5);
\r
886 Point point4 = new Point(250, 50);
\r
887 Point point5 = new Point(300, 100);
\r
888 Point point6 = new Point(350, 200);
\r
889 Point point7 = new Point(250, 250);
\r
890 Point[] curvePoints = {
\r
899 // Draw lines between original points to screen.
\r
900 t.Graphics.DrawLines(redPen, curvePoints);
\r
901 // Create offset, number of segments, and tension.
\r
903 int numSegments = 4;
\r
904 float tension = 0.7F;
\r
905 // Draw curve to screen.
\r
906 t.Graphics.DrawCurve(greenPen, curvePoints, offset, numSegments, tension);
\r
908 Assert.IsTrue(t.PDCompare());
\r
911 t.Graphics.DrawCurve(greenPen, curvePoints, tension);
\r
913 Assert.IsTrue(t.PDCompare());
\r
916 t.Graphics.DrawCurve(greenPen, curvePoints);
\r
918 Assert.IsTrue(t.PDCompare());
\r
922 public virtual void DrawCurveTestF() {
\r
924 Pen redPen = new Pen(Color.Red, 3);
\r
925 Pen greenPen = new Pen(Color.Green, 3);
\r
926 // Create points that define curve.
\r
927 PointF point1 = new PointF( 50.0F, 50.0F);
\r
928 PointF point2 = new PointF(100.0F, 25.0F);
\r
929 PointF point3 = new PointF(200.0F, 5.0F);
\r
930 PointF point4 = new PointF(250.0F, 50.0F);
\r
931 PointF point5 = new PointF(300.0F, 100.0F);
\r
932 PointF point6 = new PointF(350.0F, 200.0F);
\r
933 PointF point7 = new PointF(250.0F, 250.0F);
\r
934 PointF[] curvePoints = {
\r
943 // Draw lines between original points to screen.
\r
944 t.Graphics.DrawLines(redPen, curvePoints);
\r
945 // Create offset, number of segments, and tension.
\r
947 int numSegments = 4;
\r
948 float tension = 0.7F;
\r
949 // Draw curve to screen.
\r
950 t.Graphics.DrawCurve(greenPen, curvePoints, offset, numSegments, tension);
\r
952 Assert.IsTrue(t.PDCompare());
\r
955 t.Graphics.DrawCurve(greenPen, curvePoints, offset, numSegments);
\r
957 Assert.IsTrue(t.PDCompare());
\r
960 t.Graphics.DrawCurve(greenPen, curvePoints, tension);
\r
962 Assert.IsTrue(t.PDCompare());
\r
965 t.Graphics.DrawCurve(greenPen, curvePoints);
\r
967 Assert.IsTrue(t.PDCompare());
\r
971 public virtual void DrawEllipseTest() {
\r
973 Pen blackPen = new Pen(Color.Black, 3);
\r
974 // Create location and size of ellipse.
\r
979 // Draw ellipse to screen.
\r
980 t.Graphics.DrawEllipse(blackPen, x, y, width, height);
\r
982 Assert.IsTrue(t.PDCompare());
\r
985 t.Graphics.DrawEllipse(blackPen, new Rectangle(x, y, width, height));
\r
987 Assert.IsTrue(t.PDCompare());
\r
991 public virtual void DrawEllipseTestF() {
\r
993 Pen blackPen = new Pen(Color.Black, 3);
\r
994 // Create location and size of ellipse.
\r
997 float width = 200.0F;
\r
998 float height = 100.0F;
\r
999 // Draw ellipse to screen.
\r
1000 t.Graphics.DrawEllipse(blackPen, x, y, width, height);
\r
1002 Assert.IsTrue(t.PDCompare());
\r
1005 t.Graphics.DrawEllipse(blackPen, new RectangleF(x, y, width, height));
\r
1007 Assert.IsTrue(t.PDCompare());
\r
1010 static string getInFile (string file) {
\r
1013 sRslt = Path.GetFullPath (file);
1015 if (! File.Exists (file))
1016 sRslt = Path.Combine (
1017 Path.Combine ("..", ".."),
1024 [Category("NotWorking")]
\r
1025 public virtual void DrawIconTest() {
\r
1027 Icon newIcon = new Icon(getInFile ("SampIcon.ico"));
\r
1028 // Create coordinates for upper-left corner of icon.
\r
1031 // Draw icon to screen.
\r
1032 t.Graphics.DrawIcon(newIcon, x, y);
\r
1034 Assert.IsTrue(t.PDCompare());
\r
1036 t.Graphics.DrawIcon(newIcon, new Rectangle(200, 300, 125, 345));
\r
1038 Assert.IsTrue(t.PDCompare());
\r
1042 [Category("NotWorking")]
\r
1043 public virtual void DrawIconUnstretchedTest() {
\r
1045 Icon newIcon = new Icon(getInFile ("SampIcon.ico"));
\r
1046 // Create rectangle for icon.
\r
1047 Rectangle rect = new Rectangle( 100, 100, 200, 200);
\r
1048 // Draw icon to screen.
\r
1049 t.Graphics.DrawIconUnstretched(newIcon, rect);
\r
1051 Assert.IsTrue(t.PDCompare());
\r
1053 #if INTPTR_SUPPORTED
\r
1054 // Define DrawImageAbort callback method.
\r
1055 private bool DrawImageCallback(IntPtr callBackData) {
\r
1056 // Test for call that passes callBackData parameter.
\r
1057 if(callBackData==IntPtr.Zero) {
\r
1058 // If no callBackData passed, abort DrawImage method.
\r
1062 // If callBackData passed, continue DrawImage method.
\r
1067 [Test] //TBD: add more overrides
\r
1068 public void DrawImageTest() {
\r
1069 // Create callback method.
\r
1070 Graphics.DrawImageAbort imageCallback
\r
1071 = new Graphics.DrawImageAbort(DrawImageCallback);
\r
1072 IntPtr imageCallbackData = new IntPtr(1);
\r
1074 Image newImage = Image.FromFile("SampIcon.ico");
\r
1075 // Create rectangle for displaying original image.
\r
1076 Rectangle destRect1 = new Rectangle( 100, 25, 450, 150);
\r
1077 // Create coordinates of rectangle for source image.
\r
1080 float width = 150.0F;
\r
1081 float height = 150.0F;
\r
1082 GraphicsUnit units = GraphicsUnit.Pixel;
\r
1083 // Draw original image to screen.
\r
1084 t.Graphics.DrawImage(newImage, destRect1, x, y, width, height, units);
\r
1086 // Create rectangle for adjusted image.
\r
1087 Rectangle destRect2 = new Rectangle(100, 175, 450, 150);
\r
1088 // Create image attributes and set large gamma.
\r
1089 ImageAttributes imageAttr = new ImageAttributes();
\r
1090 imageAttr.SetGamma(4.0F);
\r
1091 // Draw adjusted image to screen.
\r
1093 t.Graphics.DrawImage(
\r
1101 imageCallbackData);
\r
1107 [Category("NotWorking")]
\r
1108 public virtual void DrawImageUnscaledTest() {
\r
1110 Image newImage = Bitmap.FromFile(getInFile ("bitmap_gh.png"));
\r
1111 // Create coordinates for upper-left corner of image.
\r
1114 // Draw image to screen.
\r
1115 t.Graphics.DrawImageUnscaled(newImage, x, y, 100, 125);
\r
1117 Assert.IsTrue(t.PDCompare());
\r
1120 t.Graphics.DrawImageUnscaled(newImage, new Rectangle(x, y, 34, 235));
\r
1122 Assert.IsTrue(t.PDCompare());
\r
1125 t.Graphics.DrawImageUnscaled(newImage, x, y);
\r
1127 Assert.IsTrue(t.PDCompare());
\r
1130 t.Graphics.DrawImageUnscaled(newImage, new Point(x, y));
\r
1132 Assert.IsTrue(t.PDCompare());
\r
1136 public virtual void DrawLineTest() {
\r
1138 Pen blackPen = new Pen(Color.Black, 3);
\r
1139 // Create coordinates of points that define line.
\r
1144 // Draw line to screen.
\r
1145 t.Graphics.DrawLine(blackPen, x1, y1, x2, y2);
\r
1147 Assert.IsTrue(t.PDCompare());
\r
1150 t.Graphics.DrawLine(blackPen, new Point( x1, y1), new Point( x2, y2));
\r
1152 Assert.IsTrue(t.PDCompare());
\r
1156 public virtual void DrawLineTestF() {
\r
1158 Pen blackPen = new Pen(Color.Black, 3);
\r
1159 // Create coordinates of points that define line.
\r
1160 float x1 = 100.0F;
\r
1161 float y1 = 100.0F;
\r
1162 float x2 = 500.0F;
\r
1163 float y2 = 100.0F;
\r
1164 // Draw line to screen.
\r
1165 t.Graphics.DrawLine(blackPen, x1, y1, x2, y2);
\r
1167 Assert.IsTrue(t.PDCompare());
\r
1170 t.Graphics.DrawLine(blackPen, new PointF( x1, y1), new PointF( x2, y2));
\r
1172 Assert.IsTrue(t.PDCompare());
\r
1176 public virtual void DrawLinesTest() {
\r
1178 Pen pen = new Pen(Color.Black, 3);
\r
1179 // Create array of points that define lines to draw.
\r
1180 Point[] points = {
\r
1181 new Point( 10, 10),
\r
1182 new Point( 10, 100),
\r
1183 new Point(200, 50),
\r
1184 new Point(250, 300)
\r
1186 //Draw lines to screen.
\r
1187 t.Graphics.DrawLines(pen, points);
\r
1189 Assert.IsTrue(t.PDCompare());
\r
1193 public virtual void DrawLinesTestF() {
\r
1195 Pen pen = new Pen(Color.Black, 3);
\r
1196 // Create array of points that define lines to draw.
\r
1197 PointF[] points = {
\r
1198 new PointF( 10.0F, 10.0F),
\r
1199 new PointF( 10.0F, 100.0F),
\r
1200 new PointF(200.0F, 50.0F),
\r
1201 new PointF(250.0F, 300.0F)
\r
1203 //Draw lines to screen.
\r
1204 t.Graphics.DrawLines(pen, points);
\r
1206 Assert.IsTrue(t.PDCompare());
\r
1210 public virtual void DrawPathTest() {
\r
1211 // Create graphics path object and add ellipse.
\r
1212 GraphicsPath graphPath = new GraphicsPath();
\r
1213 graphPath.AddEllipse(0, 0, 200, 100);
\r
1215 Pen blackPen = new Pen(Color.Black, 3);
\r
1216 // Draw graphics path to screen.
\r
1217 t.Graphics.DrawPath(blackPen, graphPath);
\r
1219 Assert.IsTrue(t.PDCompare());
\r
1223 public virtual void DrawPieTestF() {
\r
1225 Pen blackPen = new Pen(Color.Black, 3);
\r
1226 // Create location and size of ellipse.
\r
1229 float width = 200.0F;
\r
1230 float height = 100.0F;
\r
1231 // Create start and sweep angles.
\r
1232 float startAngle = 0.0F;
\r
1233 float sweepAngle = 45.0F;
\r
1234 // Draw pie to screen.
\r
1235 t.Graphics.DrawPie(blackPen, x, y, width, height, startAngle, sweepAngle);
\r
1237 Assert.IsTrue(t.PDCompare());
\r
1240 t.Graphics.DrawPie(blackPen, new RectangleF( x, y, width, height), startAngle, sweepAngle);
\r
1242 Assert.IsTrue(t.PDCompare());
\r
1246 public virtual void DrawPieTest() {
\r
1248 Pen blackPen = new Pen(Color.Black, 3);
\r
1249 // Create location and size of ellipse.
\r
1254 // Create start and sweep angles.
\r
1255 int startAngle = 0;
\r
1256 int sweepAngle = 45;
\r
1257 // Draw pie to screen.
\r
1258 t.Graphics.DrawPie(blackPen, x, y, width, height, startAngle, sweepAngle);
\r
1260 Assert.IsTrue(t.PDCompare());
\r
1263 t.Graphics.DrawPie(blackPen, new Rectangle( x, y, width, height), startAngle, sweepAngle);
\r
1265 Assert.IsTrue(t.PDCompare());
\r
1269 public virtual void DrawPolygonPoint() {
\r
1271 Pen blackPen = new Pen(Color.Black, 3);
\r
1272 // Create points that define polygon.
\r
1273 Point point1 = new Point( 50, 50);
\r
1274 Point point2 = new Point(100, 25);
\r
1275 Point point3 = new Point(200, 5);
\r
1276 Point point4 = new Point(250, 50);
\r
1277 Point point5 = new Point(300, 100);
\r
1278 Point point6 = new Point(350, 200);
\r
1279 Point point7 = new Point(250, 250);
\r
1280 Point[] curvePoints = {
\r
1289 // Draw polygon to screen.
\r
1290 t.Graphics.DrawPolygon(blackPen, curvePoints);
\r
1292 Assert.IsTrue(t.PDCompare()); // .NET's lines of polygon is more wide
\r
1296 public virtual void DrawPolygonPointF() {
\r
1298 Pen blackPen = new Pen(Color.Black, 3);
\r
1299 // Create points that define polygon.
\r
1300 PointF point1 = new PointF( 50, 50);
\r
1301 PointF point2 = new PointF(100, 25);
\r
1302 PointF point3 = new PointF(200, 5);
\r
1303 PointF point4 = new PointF(250, 50);
\r
1304 PointF point5 = new PointF(300, 100);
\r
1305 PointF point6 = new PointF(350, 200);
\r
1306 PointF point7 = new PointF(250, 250);
\r
1307 PointF[] curvePoints = {
\r
1316 // Draw polygon to screen.
\r
1317 t.Graphics.DrawPolygon(blackPen, curvePoints);
\r
1319 Assert.IsTrue(t.PDCompare());
\r
1323 public virtual void DrawRectangleFloat() {
\r
1325 Pen blackPen = new Pen(Color.Black, 3);
\r
1326 // Create location and size of rectangle.
\r
1329 float width = 200.0F;
\r
1330 float height = 200.0F;
\r
1331 // Draw rectangle to screen.
\r
1332 t.Graphics.DrawRectangle(blackPen, x, y, width, height);
\r
1334 Assert.IsTrue(t.PDCompare());
\r
1337 t.Graphics.DrawRectangle(blackPen, (int)x, (int)y, (int)width, (int)height);
\r
1339 Assert.IsTrue(t.PDCompare());
\r
1342 t.Graphics.DrawRectangle(blackPen, new Rectangle( (int)x, (int)y, (int)width, (int)height));
\r
1344 Assert.IsTrue(t.PDCompare());
\r
1348 public virtual void DrawRectanglesRectangleF() {
\r
1350 Pen blackPen = new Pen(Color.Black, 3);
\r
1351 // Create array of rectangles.
\r
1352 RectangleF[] rects = {
\r
1353 new RectangleF( 20.0F, 20.0F, 100.0F, 200.0F),
\r
1354 new RectangleF(100.0F, 200.0F, 250.0F, 50.0F),
\r
1355 new RectangleF(300.0F, 20.0F, 50.0F, 100.0F)
\r
1357 // Draw rectangles to screen.
\r
1358 t.Graphics.DrawRectangles(blackPen, rects);
\r
1360 Assert.IsTrue(t.PDCompare());
\r
1364 public virtual void DrawRectanglesRectangle() {
\r
1366 Pen blackPen = new Pen(Color.Black, 3);
\r
1367 // Create array of rectangles.
\r
1368 Rectangle[] rects = {
\r
1369 new Rectangle( 20, 20, 100, 200),
\r
1370 new Rectangle(100, 200, 250, 50),
\r
1371 new Rectangle(300, 20, 50, 100)
\r
1373 // Draw rectangles to screen.
\r
1374 t.Graphics.DrawRectangles(blackPen, rects);
\r
1376 Assert.IsTrue(t.PDCompare());
\r
1379 [Test] //TBD: add more combinations
\r
1380 [Category("NotWorking")]
\r
1381 public virtual void DrawStringFloatFormat() {
\r
1382 // Create string to draw.
\r
1383 String drawString = "Sample Text";
\r
1384 // Create font and brush.
\r
1385 Font drawFont = new Font("Arial", 34, FontStyle.Italic);
\r
1386 SolidBrush drawBrush = new SolidBrush(Color.Black);
\r
1387 // Create point for upper-left corner of drawing.
\r
1390 // Set format of string.
\r
1391 StringFormat drawFormat = new StringFormat();
\r
1392 drawFormat.FormatFlags = StringFormatFlags.DirectionVertical;
\r
1393 // Draw string to screen.
\r
1394 t.Graphics.DrawString(drawString, drawFont, drawBrush, x, y, drawFormat);
\r
1396 Assert.IsTrue(t.PDCompare()); // in .net the font is shmoothed
\r
1399 drawFormat.FormatFlags = StringFormatFlags.NoClip;
\r
1400 // Draw string to screen.
\r
1401 t.Graphics.DrawString(drawString, drawFont, drawBrush, x, y, drawFormat);
\r
1403 Assert.IsTrue(t.PDCompare());
\r
1406 drawFormat.FormatFlags = StringFormatFlags.FitBlackBox;
\r
1407 // Draw string to screen.
\r
1408 t.Graphics.DrawString(drawString, drawFont, drawBrush, x, y, drawFormat);
\r
1410 Assert.IsTrue(t.PDCompare());
\r
1414 public virtual void EndContainerState() {
\r
1415 // Begin graphics container.
\r
1416 GraphicsContainer containerState = t.Graphics.BeginContainer();
\r
1417 // Translate world transformation.
\r
1418 t.Graphics.TranslateTransform(100.0F, 100.0F);
\r
1419 // Fill translated rectangle in container with red.
\r
1420 t.Graphics.FillRectangle(new SolidBrush(Color.Red), 0, 0, 200, 200);
\r
1422 // End graphics container.
\r
1423 t.Graphics.EndContainer(containerState);
\r
1424 // Fill untransformed rectangle with green.
\r
1425 t.Graphics.FillRectangle(new SolidBrush(Color.Green), 0, 0, 200, 200);
\r
1427 Assert.IsTrue(t.PDCompare());
\r
1431 public virtual void EnumerateMetafile() {
\r
1435 public virtual void ExcludeClipRegion() {
\r
1436 // Create rectangle for exclusion.
\r
1437 Rectangle excludeRect = new Rectangle(100, 100, 200, 200);
\r
1438 // Set clipping region to exclude rectangle.
\r
1439 t.Graphics.ExcludeClip(excludeRect);
\r
1440 // Fill large rectangle to show clipping region.
\r
1441 t.Graphics.FillRectangle(new SolidBrush(Color.Blue), 0, 0, 300, 300);
\r
1443 Assert.IsTrue(t.PDCompare());
\r
1447 public virtual void FillClosedCurvePointFillModeTension() {
\r
1448 // Create solid brush.
\r
1449 SolidBrush redBrush = new SolidBrush(Color.Red);
\r
1450 // Create array of points for curve.
\r
1451 Point point1 = new Point(100, 100);
\r
1452 Point point2 = new Point(200, 50);
\r
1453 Point point3 = new Point(250, 200);
\r
1454 Point point4 = new Point( 50, 150);
\r
1455 Point[] points = {point1, point2, point3, point4};
\r
1457 FillMode newFillMode = FillMode.Winding;
\r
1459 float tension = 0.68F;
\r
1460 // Fill curve on screen.
\r
1461 t.Graphics.FillClosedCurve(redBrush, points);
\r
1463 Assert.IsTrue(t.PDCompare());
\r
1466 t.Graphics.FillClosedCurve(redBrush, points, newFillMode);
\r
1468 Assert.IsTrue(t.PDCompare());
\r
1471 newFillMode = FillMode.Alternate;
\r
1472 t.Graphics.FillClosedCurve(redBrush, points, newFillMode, tension);
\r
1474 Assert.IsTrue(t.PDCompare());
\r
1478 public virtual void FillClosedCurvePointFFillModeTension() {
\r
1479 // Create solid brush.
\r
1480 SolidBrush redBrush = new SolidBrush(Color.Red);
\r
1481 // Create array of points for curve.
\r
1482 PointF point1 = new PointF(100.0F, 100.0F);
\r
1483 PointF point2 = new PointF(200.0F, 50.0F);
\r
1484 PointF point3 = new PointF(250.0F, 200.0F);
\r
1485 PointF point4 = new PointF( 50.0F, 150.0F);
\r
1486 PointF[] points = {point1, point2, point3, point4};
\r
1488 FillMode newFillMode = FillMode.Winding;
\r
1490 float tension = 0.68F;
\r
1491 // Fill curve on screen.
\r
1492 t.Graphics.FillClosedCurve(redBrush, points);
\r
1494 Assert.IsTrue(t.PDCompare());
\r
1497 t.Graphics.FillClosedCurve(redBrush, points, newFillMode);
\r
1499 Assert.IsTrue(t.PDCompare());
\r
1502 newFillMode = FillMode.Alternate;
\r
1503 t.Graphics.FillClosedCurve(redBrush, points, newFillMode, tension);
\r
1505 Assert.IsTrue(t.PDCompare());
\r
1509 public virtual void FillEllipse() {
\r
1510 // Create solid brush.
\r
1511 SolidBrush redBrush = new SolidBrush(Color.Red);
\r
1512 // Create location and size of ellipse.
\r
1517 // Fill ellipse on screen.
\r
1518 t.Graphics.FillEllipse(redBrush, x, y, width, height);
\r
1520 Assert.IsTrue(t.PDCompare());
\r
1523 t.Graphics.FillEllipse(redBrush, new Rectangle( x, y, width, height));
\r
1525 Assert.IsTrue(t.PDCompare());
\r
1529 public virtual void FillEllipseFloat() {
\r
1530 // Create solid brush.
\r
1531 SolidBrush redBrush = new SolidBrush(Color.Red);
\r
1532 // Create location and size of ellipse.
\r
1535 float width = 200.0F;
\r
1536 float height = 100.0F;
\r
1537 // Fill ellipse on screen.
\r
1538 t.Graphics.FillEllipse(redBrush, x, y, width, height);
\r
1540 Assert.IsTrue(t.PDCompare());
\r
1543 t.Graphics.FillEllipse(redBrush, new RectangleF( x, y, width, height));
\r
1545 Assert.IsTrue(t.PDCompare());
\r
1549 public virtual void FillPathEllipse() {
\r
1550 // Create solid brush.
\r
1551 SolidBrush redBrush = new SolidBrush(Color.Red);
\r
1552 // Create graphics path object and add ellipse.
\r
1553 GraphicsPath graphPath = new GraphicsPath();
\r
1554 graphPath.AddEllipse(0, 0, 200, 100);
\r
1555 // Fill graphics path to screen.
\r
1556 t.Graphics.FillPath(redBrush, graphPath);
\r
1558 Assert.IsTrue(t.PDCompare());
\r
1562 public virtual void FillPieFloat() {
\r
1563 // Create solid brush.
\r
1564 SolidBrush redBrush = new SolidBrush(Color.Red);
\r
1565 // Create location and size of ellipse.
\r
1570 // Create start and sweep angles.
\r
1571 float startAngle = 0.0F;
\r
1572 float sweepAngle = 45.0F;
\r
1573 // Fill pie to screen.
\r
1574 t.Graphics.FillPie(redBrush, new Rectangle(x, y, width, height), startAngle, sweepAngle);
\r
1576 Assert.IsTrue(t.PDCompare());
\r
1579 t.Graphics.FillPie(redBrush, x, y, width, height, (int)startAngle, (int)sweepAngle);
\r
1581 Assert.IsTrue(t.PDCompare());
\r
1584 t.Graphics.FillPie(redBrush, (float)x, (float)y, (float)width, (float)height, startAngle, sweepAngle);
\r
1586 Assert.IsTrue(t.PDCompare());
\r
1590 public virtual void FillPolygonPointFillMode() {
\r
1591 // Create solid brush.
\r
1592 SolidBrush blueBrush = new SolidBrush(Color.Blue);
\r
1593 // Create points that define polygon.
\r
1594 Point point1 = new Point( 50, 50);
\r
1595 Point point2 = new Point(100, 25);
\r
1596 Point point3 = new Point(200, 5);
\r
1597 Point point4 = new Point(250, 50);
\r
1598 Point point5 = new Point(300, 100);
\r
1599 Point point6 = new Point(350, 200);
\r
1600 Point point7 = new Point(250, 250);
\r
1601 Point[] curvePoints = {
\r
1611 // Fill polygon to screen.
\r
1612 t.Graphics.FillPolygon(blueBrush, curvePoints, FillMode.Winding);
\r
1614 Assert.IsTrue(t.PDCompare());
\r
1617 t.Graphics.FillPolygon(blueBrush, curvePoints, FillMode.Alternate);
\r
1619 Assert.IsTrue(t.PDCompare());
\r
1622 t.Graphics.FillPolygon(blueBrush, curvePoints);
\r
1624 Assert.IsTrue(t.PDCompare());
\r
1628 public virtual void FillPolygonPointFFillMode() {
\r
1629 // Create solid brush.
\r
1630 SolidBrush blueBrush = new SolidBrush(Color.Blue);
\r
1631 // Create points that define polygon.
\r
1632 PointF point1 = new PointF( 50.0F, 50.0F);
\r
1633 PointF point2 = new PointF(100.0F, 25.0F);
\r
1634 PointF point3 = new PointF(200.0F, 5.0F);
\r
1635 PointF point4 = new PointF(250.0F, 50.0F);
\r
1636 PointF point5 = new PointF(300.0F, 100.0F);
\r
1637 PointF point6 = new PointF(350.0F, 200.0F);
\r
1638 PointF point7 = new PointF(250.0F, 250.0F);
\r
1639 PointF[] curvePoints = {
\r
1649 // Fill polygon to screen.
\r
1650 t.Graphics.FillPolygon(blueBrush, curvePoints, FillMode.Winding);
\r
1652 Assert.IsTrue(t.PDCompare());
\r
1655 t.Graphics.FillPolygon(blueBrush, curvePoints, FillMode.Alternate);
\r
1657 Assert.IsTrue(t.PDCompare());
\r
1660 t.Graphics.FillPolygon(blueBrush, curvePoints);
\r
1662 Assert.IsTrue(t.PDCompare());
\r
1666 public virtual void FillRectangle() {
\r
1667 // Create solid brush.
\r
1668 SolidBrush blueBrush = new SolidBrush(Color.Blue);
\r
1669 // Create location and size of rectangle.
\r
1674 // Fill rectangle to screen.
\r
1675 t.Graphics.FillRectangle(blueBrush, x, y, width, height);
\r
1677 Assert.IsTrue(t.PDCompare());
\r
1680 t.Graphics.FillRectangle(blueBrush, new Rectangle( x, y, width, height));
\r
1682 Assert.IsTrue(t.PDCompare());
\r
1686 public virtual void FillRectangleFloat() {
\r
1687 // Create solid brush.
\r
1688 SolidBrush blueBrush = new SolidBrush(Color.Blue);
\r
1689 // Create location and size of rectangle.
\r
1692 float width = 300.0F;
\r
1693 float height = 200.0F;
\r
1694 // Fill rectangle to screen.
\r
1695 t.Graphics.FillRectangle(blueBrush, x, y, width, height);
\r
1697 Assert.IsTrue(t.PDCompare());
\r
1700 t.Graphics.FillRectangle(blueBrush, new RectangleF( x, y, width, height));
\r
1702 Assert.IsTrue(t.PDCompare());
\r
1706 public virtual void FillRectanglesRectangle() {
\r
1707 // Create solid brush.
\r
1708 SolidBrush blueBrush = new SolidBrush(Color.Blue);
\r
1709 // Create array of rectangles.
\r
1710 Rectangle[] rects = {
\r
1711 new Rectangle( 0, 0, 100, 200),
\r
1712 new Rectangle(100, 200, 250, 50),
\r
1713 new Rectangle(300, 0, 50, 100)
\r
1715 // Fill rectangles to screen.
\r
1716 t.Graphics.FillRectangles(blueBrush, rects);
\r
1718 Assert.IsTrue(t.PDCompare());
\r
1722 public virtual void FillRectanglesRectangleF() {
\r
1723 // Create solid brush.
\r
1724 SolidBrush blueBrush = new SolidBrush(Color.Blue);
\r
1725 // Create array of rectangles.
\r
1726 RectangleF[] rects = {
\r
1727 new RectangleF( 0.0F, 0.0F, 100.0F, 200.0F),
\r
1728 new RectangleF(100.0F, 200.0F, 250.0F, 50.0F),
\r
1729 new RectangleF(300.0F, 0.0F, 50.0F, 100.0F)
\r
1731 // Fill rectangles to screen.
\r
1732 t.Graphics.FillRectangles(blueBrush, rects);
\r
1734 Assert.IsTrue(t.PDCompare());
\r
1738 public virtual void FillRegionRectangle() {
\r
1739 // Create solid brush.
\r
1740 SolidBrush blueBrush = new SolidBrush(Color.Blue);
\r
1741 // Create rectangle for region.
\r
1742 Rectangle fillRect = new Rectangle(100, 150, 200, 250);
\r
1743 // Create region for fill.
\r
1744 Region fillRegion = new Region(fillRect);
\r
1745 // Fill region to screen.
\r
1746 t.Graphics.FillRegion(blueBrush, fillRegion);
\r
1748 Assert.IsTrue(t.PDCompare());
\r
1752 public virtual void FlushTest() {
\r
1753 t.Graphics.Flush();
\r
1754 t.Graphics.Flush(FlushIntention.Flush);
\r
1758 public virtual void IntersectClipRegion() {
\r
1759 // Set clipping region.
\r
1760 Rectangle clipRect = new Rectangle(0, 0, 200, 300);
\r
1761 Region clipRegion = new Region(clipRect);
\r
1762 t.Graphics.SetClip(clipRegion, CombineMode.Replace);
\r
1763 // Update clipping region to intersection of
\r
1764 // existing region with specified rectangle.
\r
1765 Rectangle intersectRect = new Rectangle(100, 100, 200, 300);
\r
1766 Region intersectRegion = new Region(intersectRect);
\r
1767 t.Graphics.IntersectClip(intersectRegion);
\r
1768 // Fill rectangle to demonstrate effective clipping region.
\r
1769 t.Graphics.FillRectangle(new SolidBrush(Color.Blue), 0, 0, 500, 600);
\r
1771 // Reset clipping region to infinite.
\r
1772 t.Graphics.ResetClip();
\r
1773 // Draw clipRect and intersectRect to screen.
\r
1774 t.Graphics.DrawRectangle(new Pen(Color.Black), clipRect);
\r
1776 t.Graphics.DrawRectangle(new Pen(Color.Red), intersectRect);
\r
1778 Assert.IsTrue(t.PDCompare());
\r
1782 public virtual void IsVisible4Float() {
\r
1783 // Set clip region.
\r
1784 Region clipRegion = new Region(new Rectangle(50, 50, 100, 100));
\r
1785 t.Graphics.SetClip(clipRegion, CombineMode.Replace);
\r
1786 // Set up coordinates of rectangles.
\r
1787 float x1 = 100.0F;
\r
1788 float y1 = 100.0F;
\r
1789 float width1 = 20.0F;
\r
1790 float height1 = 20.0F;
\r
1791 float x2 = 200.0F;
\r
1792 float y2 = 200.0F;
\r
1793 float width2 = 20.0F;
\r
1794 float height2 = 20.0F;
\r
1795 // If rectangle is visible, fill it.
\r
1796 if (t.Graphics.IsVisible(x1, y1, width1, height1)) {
\r
1797 t.Graphics.FillRectangle(new SolidBrush(Color.Red), x1, y1, width1, height1);
\r
1800 if (t.Graphics.IsVisible(x2, y2, width2, height2)) {
\r
1801 t.Graphics.FillRectangle(new SolidBrush(Color.Blue), x2, y2, width2, height2);
\r
1805 Assert.IsTrue(t.PDCompare());
\r
1809 [Category("NotWorking")]
\r
1810 public virtual void MeasureCharacterRangesRegions() {
\r
1812 string measureString = "First and Second ranges";
\r
1813 Font stringFont = new Font("Times New Roman", 16.0F);
\r
1814 // Set character ranges to "First" and "Second".
\r
1815 CharacterRange[] characterRanges = {
\r
1816 new CharacterRange(0, 5),
\r
1817 new CharacterRange(10, 6)
\r
1819 // Create rectangle for layout.
\r
1822 float width = 35.0F;
\r
1823 float height = 200.0F;
\r
1824 RectangleF layoutRect = new RectangleF(x, y, width, height);
\r
1825 // Set string format.
\r
1826 StringFormat stringFormat = new StringFormat();
\r
1827 stringFormat.FormatFlags = StringFormatFlags.DirectionVertical;
\r
1828 stringFormat.SetMeasurableCharacterRanges(characterRanges);
\r
1829 // Draw string to screen.
\r
1830 t.Graphics.DrawString(
\r
1836 // Measure two ranges in string.
\r
1837 Region[] stringRegions = new Region[2];
\r
1838 stringRegions = t.Graphics.MeasureCharacterRanges(
\r
1843 // Draw rectangle for first measured range.
\r
1844 RectangleF measureRect1 = stringRegions[0].GetBounds(t.Graphics);
\r
1845 t.Graphics.DrawRectangle(
\r
1846 new Pen(Color.Red, 1),
\r
1847 Rectangle.Round(measureRect1));
\r
1849 // Draw rectangle for second measured range.
\r
1850 RectangleF measureRect2 = stringRegions[1].GetBounds(t.Graphics);
\r
1851 t.Graphics.DrawRectangle(
\r
1852 new Pen(Color.Blue, 1),
\r
1853 Rectangle.Round(measureRect2));
\r
1855 Assert.IsTrue(t.PDCompare());
\r
1858 [Test] //TBD: add more overloads
\r
1859 [Category("NotWorking")]
\r
1860 public virtual void MeasureStringSizeFFormatInts() {
\r
1862 string measureString = "Measure String";
\r
1863 Font stringFont = new Font("Arial", 16);
\r
1864 // Set maximum layout size.
\r
1865 SizeF layoutSize = new SizeF(100.0F, 200.0F);
\r
1866 // Set string format.
\r
1867 StringFormat newStringFormat = new StringFormat();
\r
1868 newStringFormat.FormatFlags = StringFormatFlags.DirectionVertical;
\r
1869 // Measure string.
\r
1870 int charactersFitted;
\r
1872 SizeF stringSize = new SizeF();
\r
1873 stringSize = t.Graphics.MeasureString(
\r
1878 out charactersFitted,
\r
1880 // Draw rectangle representing size of string.
\r
1881 t.Graphics.DrawRectangle(
\r
1882 new Pen(Color.Red, 1),
\r
1883 0.0F, 0.0F, stringSize.Width, stringSize.Height);
\r
1885 // Draw string to screen.
\r
1886 t.Graphics.DrawString(
\r
1893 // Draw output parameters to screen.
\r
1894 string outString = "chars " + charactersFitted + ", lines " + linesFilled;
\r
1895 t.Graphics.DrawString(
\r
1899 new PointF(100, 0));
\r
1901 Assert.IsTrue(t.PDCompare());
\r
1905 public virtual void MultiplyTransform() {
\r
1906 // Create transform matrix.
\r
1907 Matrix transformMatrix = new Matrix();
\r
1908 // Translate matrix, prepending translation vector.
\r
1909 transformMatrix.Translate(200.0F, 100.0F);
\r
1910 // Rotate transformation matrix of graphics object,
\r
1911 // prepending rotation matrix.
\r
1912 t.Graphics.RotateTransform(30.0F);
\r
1913 // Multiply (append to) transformation matrix of
\r
1914 // graphics object to translate graphics transformation.
\r
1915 t.Graphics.MultiplyTransform(transformMatrix);
\r
1916 // Draw rotated, translated ellipse.
\r
1917 t.Graphics.DrawEllipse(new Pen(Color.Blue, 3), -80, -40, 160, 80);
\r
1919 Assert.IsTrue(t.PDCompare());
\r
1923 public virtual void MultiplyTransformMatrixOrder() {
\r
1924 // Create transform matrix.
\r
1925 Matrix transformMatrix = new Matrix();
\r
1926 // Translate matrix, prepending translation vector.
\r
1927 transformMatrix.Translate(200.0F, 100.0F);
\r
1928 // Rotate transformation matrix of graphics object,
\r
1929 // prepending rotation matrix.
\r
1930 t.Graphics.RotateTransform(30.0F);
\r
1931 // Multiply (append to) transformation matrix of
\r
1932 // graphics object to translate graphics transformation.
\r
1933 t.Graphics.MultiplyTransform(transformMatrix, MatrixOrder.Append);
\r
1934 // Draw rotated, translated ellipse.
\r
1935 t.Graphics.DrawEllipse(new Pen(Color.Blue, 3), -80, -40, 160, 80);
\r
1937 Assert.IsTrue(t.PDCompare());
\r
1941 public virtual void MultiplyTransformMatrixOrder1() {
\r
1942 // Create transform matrix.
\r
1943 Matrix transformMatrix = new Matrix();
\r
1944 // Translate matrix, prepending translation vector.
\r
1945 transformMatrix.Translate(200.0F, 100.0F);
\r
1946 // Rotate transformation matrix of graphics object,
\r
1947 // prepending rotation matrix.
\r
1948 t.Graphics.RotateTransform(30.0F);
\r
1949 // Multiply (append to) transformation matrix of
\r
1950 // graphics object to translate graphics transformation.
\r
1951 t.Graphics.MultiplyTransform(transformMatrix, MatrixOrder.Prepend);
\r
1952 // Draw rotated, translated ellipse.
\r
1953 t.Graphics.DrawEllipse(new Pen(Color.Blue, 3), -80, -40, 160, 80);
\r
1955 Assert.IsTrue(t.PDCompare());
\r
1959 public virtual void ResetClipIntersectClipRectangleF() {
\r
1960 // Set clipping region.
\r
1961 Rectangle clipRect = new Rectangle(0, 0, 200, 200);
\r
1962 t.Graphics.SetClip(clipRect);
\r
1963 // Update clipping region to intersection of existing region with new rectangle.
\r
1964 RectangleF intersectRectF = new RectangleF(100.0F, 100.0F, 200.0F, 200.0F);
\r
1965 t.Graphics.IntersectClip(intersectRectF);
\r
1966 // Fill rectangle to demonstrate effective clipping region.
\r
1967 t.Graphics.FillRectangle(new SolidBrush(Color.Blue), 0, 0, 500, 500);
\r
1968 // Reset clipping region to infinite.
\r
1969 t.Graphics.ResetClip();
\r
1970 // Draw clipRect and intersectRect to screen.
\r
1971 t.Graphics.DrawRectangle(new Pen(Color.Black), clipRect);
\r
1972 t.Graphics.DrawRectangle(new Pen(Color.Red), Rectangle.Round(intersectRectF));
\r
1974 Assert.IsTrue(t.PDCompare());
\r
1978 public virtual void SaveRestoreTranslate() {
\r
1979 // Translate transformation matrix.
\r
1980 t.Graphics.TranslateTransform(100, 0);
\r
1981 // Save translated graphics state.
\r
1982 GraphicsState transState = t.Graphics.Save();
\r
1983 // Reset transformation matrix to identity and fill rectangle.
\r
1984 t.Graphics.ResetTransform();
\r
1985 t.Graphics.FillRectangle(new SolidBrush(Color.Red), 0, 0, 100, 100);
\r
1987 // Restore graphics state to translated state and fill second rectangle.
\r
1988 t.Graphics.Restore(transState);
\r
1989 t.Graphics.FillRectangle(new SolidBrush(Color.Blue), 0, 0, 100, 100);
\r
1991 Assert.IsTrue(t.PDCompare());
\r
1995 public virtual void RotateTransformAngleMatrixOrder() {
\r
1996 // Set world transform of graphics object to translate.
\r
1997 t.Graphics.TranslateTransform(100.0F, 0.0F);
\r
1998 // Then to rotate, appending rotation matrix.
\r
1999 t.Graphics.RotateTransform(30.0F, MatrixOrder.Append);
\r
2000 // Draw translated, rotated ellipse to screen.
\r
2001 t.Graphics.DrawEllipse(new Pen(Color.Blue, 3), 0, 0, 200, 80);
\r
2003 Assert.IsTrue(t.PDCompare());
\r
2007 public virtual void RotateTransformAngleMatrixOrder1() {
\r
2008 // Set world transform of graphics object to translate.
\r
2009 t.Graphics.TranslateTransform(100.0F, 0.0F);
\r
2010 // Then to rotate, appending rotation matrix.
\r
2011 t.Graphics.RotateTransform(30.0F, MatrixOrder.Prepend);
\r
2012 // Draw translated, rotated ellipse to screen.
\r
2013 t.Graphics.DrawEllipse(new Pen(Color.Blue, 3), 0, 0, 200, 80);
\r
2015 Assert.IsTrue(t.PDCompare()); // Line width problem
\r
2019 public virtual void ScaleTransformFloatMatrixOrder() {
\r
2020 // Set world transform of graphics object to rotate.
\r
2021 t.Graphics.RotateTransform(30.0F);
\r
2022 // Then to scale, appending to world transform.
\r
2023 t.Graphics.ScaleTransform(3.0F, 1.0F, MatrixOrder.Append);
\r
2024 // Draw rotated, scaled rectangle to screen.
\r
2025 t.Graphics.DrawRectangle(new Pen(Color.Blue, 3), 50, 0, 100, 40);
\r
2027 Assert.IsTrue(t.PDCompare()); // Line width problem
\r
2031 public virtual void ScaleTransformFloatMatrixOrder1() {
\r
2032 // Set world transform of graphics object to rotate.
\r
2033 t.Graphics.RotateTransform(30.0F);
\r
2034 // Then to scale, appending to world transform.
\r
2035 t.Graphics.ScaleTransform(3.0F, 1.0F, MatrixOrder.Prepend);
\r
2036 // Draw rotated, scaled rectangle to screen.
\r
2037 t.Graphics.DrawRectangle(new Pen(Color.Blue, 3), 50, 0, 100, 40);
\r
2039 Assert.IsTrue(t.PDCompare());
\r
2042 [Test] //TBD: add more combination
\r
2043 public virtual void SetClipRegionCombine() {
\r
2044 // Create region for clipping.
\r
2045 Region clipRegion = new Region(new Rectangle(0, 0, 200, 100));
\r
2046 // Set clipping region of graphics to region.
\r
2047 t.Graphics.SetClip(clipRegion, CombineMode.Replace);
\r
2048 // Fill rectangle to demonstrate clip region.
\r
2049 t.Graphics.FillRectangle(new SolidBrush(Color.Black), 0, 0, 500, 300);
\r
2051 Assert.IsTrue(t.PDCompare());
\r
2055 public virtual void TransformPointsPointF() {
\r
2056 // Create array of two points.
\r
2057 PointF[] points = {new PointF(0.0F, 0.0F),
\r
2058 new PointF(100.0F, 50.0F)};
\r
2059 // Draw line connecting two untransformed points.
\r
2060 t.Graphics.DrawLine(new Pen(Color.Blue, 3),
\r
2063 // Set world transformation of Graphics object to translate.
\r
2064 t.Graphics.TranslateTransform(40.0F, 30.0F);
\r
2065 // Transform points in array from world to page coordinates.
\r
2066 t.Graphics.TransformPoints(CoordinateSpace.Page,
\r
2067 CoordinateSpace.World,
\r
2069 // Reset world transformation.
\r
2070 t.Graphics.ResetTransform();
\r
2071 // Draw line that connects transformed points.
\r
2072 t.Graphics.DrawLine(new Pen(Color.Red, 3),
\r
2076 Assert.IsTrue(t.PDCompare());
\r
2080 public virtual void TranslateClipFloat() {
\r
2081 // Create rectangle for clipping region.
\r
2082 RectangleF clipRect = new RectangleF(0.0F, 0.0F, 100.0F, 100.0F);
\r
2083 // Set clipping region of graphics to rectangle.
\r
2084 t.Graphics.SetClip(clipRect);
\r
2085 // Translate clipping region.
\r
2088 t.Graphics.TranslateClip(dx, dy);
\r
2089 // Fill rectangle to demonstrate translated clip region.
\r
2090 t.Graphics.FillRectangle(new SolidBrush(Color.Black), 0, 0, 500, 300);
\r
2092 Assert.IsTrue(t.PDCompare());
\r
2096 public virtual void TranslateTransformAngleMatrixOrder() {
\r
2097 // Set world transform of graphics object to rotate.
\r
2098 t.Graphics.RotateTransform(30.0F);
\r
2099 // Then to translate, appending to world transform.
\r
2100 t.Graphics.TranslateTransform(100.0F, 0.0F, MatrixOrder.Append);
\r
2101 // Draw rotated, translated ellipse to screen.
\r
2102 t.Graphics.DrawEllipse(new Pen(Color.Blue, 3), 0, 0, 200, 80);
\r
2104 Assert.IsTrue(t.PDCompare()); // Line width problem
\r
2108 public virtual void TranslateTransformAngleMatrixOrder1() {
\r
2109 // Set world transform of graphics object to rotate.
\r
2110 t.Graphics.RotateTransform(30.0F);
\r
2111 // Then to translate, appending to world transform.
\r
2112 t.Graphics.TranslateTransform(100.0F, 0.0F, MatrixOrder.Prepend);
\r
2113 // Draw rotated, translated ellipse to screen.
\r
2114 t.Graphics.DrawEllipse(new Pen(Color.Blue, 3), 0, 0, 200, 80);
\r
2116 Assert.IsTrue(t.PDCompare());
\r
2120 public virtual void TransfromPageScaleUnits() {
\r
2121 t.Graphics.PageUnit = GraphicsUnit.Millimeter;
\r
2122 t.Graphics.PageScale = 1.0F;
\r
2123 t.Graphics.DrawLine(Pens.Red, 10, 70, 70, 10);
\r
2125 t.Graphics.PageUnit = GraphicsUnit.Document;
\r
2126 t.Graphics.PageScale = 10.0F;
\r
2127 t.Graphics.DrawLine(Pens.Blue, 10, 70, 70, 10);
\r
2129 t.Graphics.PageUnit = GraphicsUnit.Inch;
\r
2130 t.Graphics.PageScale = 0.055F;
\r
2131 t.Graphics.DrawLine(Pens.Green, 10, 70, 70, 10);
\r
2133 Matrix mx=new Matrix(0.5f,0,0,0.5f,0,0);
\r
2134 t.Graphics.Transform = mx;
\r
2136 t.Graphics.PageUnit = GraphicsUnit.Inch;
\r
2137 t.Graphics.DrawLine(Pens.Black, 10, 70, 70, 10);
\r
2139 t.Graphics.PageUnit = GraphicsUnit.Point;
\r
2140 t.Graphics.PageScale = 2.7F;
\r
2141 t.Graphics.DrawLine(Pens.Yellow, 10, 70, 70, 10);
\r
2144 Assert.IsTrue(t.PDCompare());
\r
2148 public virtual void TransfromPageScaleUnits_2() {
\r
2149 t.Graphics.RotateTransform(45);
\r
2150 t.Graphics.PageUnit = GraphicsUnit.Millimeter;
\r
2151 t.Graphics.PageScale = 1.0F;
\r
2152 t.Graphics.DrawLine(Pens.Red, 10, 70, 70, 10);
\r
2154 t.Graphics.TranslateTransform(100, 0);
\r
2155 t.Graphics.PageUnit = GraphicsUnit.Pixel;
\r
2156 t.Graphics.PageScale = 2.0F;
\r
2157 t.Graphics.DrawLine(Pens.Blue, 10, 70, 70, 10);
\r
2159 t.Graphics.ResetTransform();
\r
2160 t.Graphics.DrawLine(Pens.Green, 10, 70, 70, 10);
\r
2163 Assert.IsTrue(t.PDCompare());
\r
2166 public virtual void TransfromPageScaleUnits_3() {
\r
2167 t.Graphics.TranslateTransform(20, 20);
\r
2168 t.Graphics.PageUnit = GraphicsUnit.Millimeter;
\r
2169 t.Graphics.PageScale = 1.0F;
\r
2170 t.Graphics.DrawLine(Pens.Red, 10, 70, 70, 10);
\r
2172 t.Graphics.TranslateTransform(10, 10);
\r
2173 t.Graphics.PageUnit = GraphicsUnit.Millimeter;
\r
2174 t.Graphics.PageScale = 1.0F;
\r
2175 t.Graphics.DrawLine(Pens.Red, 10, 70, 70, 10);
\r
2177 t.Graphics.RotateTransform(15);
\r
2179 t.Graphics.PageUnit = GraphicsUnit.Millimeter;
\r
2180 t.Graphics.PageScale = 0.5F;
\r
2181 t.Graphics.DrawLine(Pens.Red, 10, 70, 70, 10);
\r
2183 t.Graphics.PageUnit = GraphicsUnit.Pixel;
\r
2184 t.Graphics.PageScale = 0.5F;
\r
2185 t.Graphics.DrawLine(Pens.Red, 10, 70, 70, 10);
\r
2187 t.Graphics.PageUnit = GraphicsUnit.Pixel;
\r
2188 t.Graphics.TranslateTransform(0, 0);
\r
2189 t.Graphics.PageScale = 1.5F;
\r
2190 t.Graphics.DrawLine(Pens.Red, 10, 70, 70, 10);
\r
2193 Assert.IsTrue(t.PDCompare());
\r
2200 #region GraphicsFixturePropClip
\r
2203 public class GraphicsFixturePropClip : GraphicsFixture {
\r
2204 public override void SetUp() {
\r
2205 base.SetUp ("GraphicsFixturePropClip");
\r
2206 t.Graphics.Clip = new Region(new Rectangle(10, 10, 100, 100));
\r
2208 st["DrawArcTest:6"] = TOLERANCE * 5.0f;
\r
2209 st["DrawArcTest:8"] = TOLERANCE * 3.7f;
\r
2210 st["DrawLinesTest:2"] = TOLERANCE * 3.0f;
\r
2211 st["DrawLinesTestF:2"] = TOLERANCE * 3.0f;
\r
2212 st["DrawPieTestF:2"] = TOLERANCE * 2.0f;
\r
2213 st["DrawPieTestF:4"] = TOLERANCE * 2.0f;
\r
2214 st["DrawPieTest:2"] = TOLERANCE * 2.0f;
\r
2215 st["DrawPieTest:4"] = TOLERANCE * 2.0f;
\r
2216 st["FillClosedCurvePointFillModeTension:2"] = TOLERANCE * 1.5f;
\r
2217 st["FillClosedCurvePointFFillModeTension:2"] = TOLERANCE * 1.5f;
\r
2218 st["FillClosedCurvePointFillModeTension:4"] = TOLERANCE * 1.5f;
\r
2219 st["FillClosedCurvePointFFillModeTension:4"] = TOLERANCE * 1.5f;
\r
2220 st["FillClosedCurvePointFillModeTension:5"] = TOLERANCE * 1.5f;
\r
2221 st["FillClosedCurvePointFFillModeTension:6"] = TOLERANCE * 1.5f;
\r
2222 st["ScaleTransformFloatMatrixOrder1:2"] = TOLERANCE * 3.5f;
\r
2226 [Category("NotWorking")]
\r
2227 public override void DrawIconTest() {
\r
2228 base.DrawIconTest ();
\r
2232 [Category("NotWorking")]
\r
2233 public override void DrawIconUnstretchedTest() {
\r
2234 base.DrawIconUnstretchedTest ();
\r
2238 public override void DrawImageUnscaledTest() {
\r
2239 base.DrawImageUnscaledTest ();
\r
2243 public override void DrawStringFloatFormat() {
\r
2244 base.DrawStringFloatFormat ();
\r
2248 [Category("NotWorking")]
\r
2249 public override void MeasureCharacterRangesRegions() {
\r
2250 base.MeasureCharacterRangesRegions ();
\r
2254 [Category("NotWorking")]
\r
2255 public override void MeasureStringSizeFFormatInts() {
\r
2256 base.MeasureStringSizeFFormatInts ();
\r
2262 #region GraphicsFixturePropCompositingMode
\r
2265 public class GraphicsFixturePropCompositingMode1 : GraphicsFixture {
\r
2266 public override void SetUp() {
\r
2267 base.SetUp ("GraphicsFixturePropCompositingMode1");
\r
2268 t.Graphics.CompositingMode = CompositingMode.SourceCopy;
\r
2272 [Category("NotWorking")]
\r
2273 public override void DrawIconTest() {
\r
2274 base.DrawIconTest ();
\r
2278 [Category("NotWorking")]
\r
2279 public override void DrawIconUnstretchedTest() {
\r
2280 base.DrawIconUnstretchedTest ();
\r
2284 [Category("NotWorking")]
\r
2285 public override void DrawImageUnscaledTest() {
\r
2286 base.DrawImageUnscaledTest ();
\r
2290 [Category("NotWorking")]
\r
2291 public override void DrawStringFloatFormat() {
\r
2292 base.DrawStringFloatFormat ();
\r
2296 [Category("NotWorking")]
\r
2297 public override void MeasureCharacterRangesRegions() {
\r
2298 base.MeasureCharacterRangesRegions ();
\r
2302 [Category("NotWorking")]
\r
2303 public override void MeasureStringSizeFFormatInts() {
\r
2304 base.MeasureStringSizeFFormatInts ();
\r
2309 public class GraphicsFixturePropCompositingMode2 : GraphicsFixture {
\r
2310 public override void SetUp() {
\r
2311 base.SetUp ("GraphicsFixturePropCompositingMode2");
\r
2312 t.Graphics.CompositingMode = CompositingMode.SourceOver;
\r
2316 [Category("NotWorking")]
\r
2317 public override void DrawIconTest() {
\r
2318 base.DrawIconTest ();
\r
2322 [Category("NotWorking")]
\r
2323 public override void DrawIconUnstretchedTest() {
\r
2324 base.DrawIconUnstretchedTest ();
\r
2328 [Category("NotWorking")]
\r
2329 public override void DrawImageUnscaledTest() {
\r
2330 base.DrawImageUnscaledTest ();
\r
2334 [Category("NotWorking")]
\r
2335 public override void DrawStringFloatFormat() {
\r
2336 base.DrawStringFloatFormat ();
\r
2340 [Category("NotWorking")]
\r
2341 public override void MeasureCharacterRangesRegions() {
\r
2342 base.MeasureCharacterRangesRegions ();
\r
2346 [Category("NotWorking")]
\r
2347 public override void MeasureStringSizeFFormatInts() {
\r
2348 base.MeasureStringSizeFFormatInts ();
\r
2354 #region GraphicsFixturePropInterpolationMode
\r
2357 public class GraphicsFixturePropInterpolationMode1 : GraphicsFixture {
\r
2358 public override void SetUp() {
\r
2359 base.SetUp ("GraphicsFixturePropInterpolationMode1");
\r
2360 t.Graphics.InterpolationMode = InterpolationMode.Bilinear;
\r
2364 [Category("NotWorking")]
\r
2365 public override void DrawIconTest() {
\r
2366 base.DrawIconTest ();
\r
2370 [Category("NotWorking")]
\r
2371 public override void DrawIconUnstretchedTest() {
\r
2372 base.DrawIconUnstretchedTest ();
\r
2376 [Category("NotWorking")]
\r
2377 public override void DrawImageUnscaledTest() {
\r
2378 base.DrawImageUnscaledTest ();
\r
2382 [Category("NotWorking")]
\r
2383 public override void DrawStringFloatFormat() {
\r
2384 base.DrawStringFloatFormat ();
\r
2388 [Category("NotWorking")]
\r
2389 public override void MeasureCharacterRangesRegions() {
\r
2390 base.MeasureCharacterRangesRegions ();
\r
2394 [Category("NotWorking")]
\r
2395 public override void MeasureStringSizeFFormatInts() {
\r
2396 base.MeasureStringSizeFFormatInts ();
\r
2401 public class GraphicsFixturePropInterpolationMode2 : GraphicsFixture {
\r
2402 public override void SetUp() {
\r
2403 base.SetUp ("GraphicsFixturePropInterpolationMode2");
\r
2404 t.Graphics.InterpolationMode = InterpolationMode.Bicubic;
\r
2408 [Category("NotWorking")]
\r
2409 public override void DrawIconTest() {
\r
2410 base.DrawIconTest ();
\r
2414 [Category("NotWorking")]
\r
2415 public override void DrawIconUnstretchedTest() {
\r
2416 base.DrawIconUnstretchedTest ();
\r
2420 [Category("NotWorking")]
\r
2421 public override void DrawImageUnscaledTest() {
\r
2422 base.DrawImageUnscaledTest ();
\r
2426 [Category("NotWorking")]
\r
2427 public override void DrawStringFloatFormat() {
\r
2428 base.DrawStringFloatFormat ();
\r
2432 [Category("NotWorking")]
\r
2433 public override void MeasureCharacterRangesRegions() {
\r
2434 base.MeasureCharacterRangesRegions ();
\r
2438 [Category("NotWorking")]
\r
2439 public override void MeasureStringSizeFFormatInts() {
\r
2440 base.MeasureStringSizeFFormatInts ();
\r
2446 #region GraphicsFixturePropPageScale
\r
2449 public class GraphicsFixturePropPageScale : GraphicsFixture {
\r
2450 public override void SetUp() {
\r
2451 base.SetUp ("GraphicsFixturePropPageScale");
\r
2453 t.Graphics.PageScale = 4.34f;
\r
2454 t.Graphics.PageUnit = GraphicsUnit.Pixel;
\r
2456 st["IntersectClipRegion:4"] = TOLERANCE * 1.5f;
\r
2457 st["ResetClipIntersectClipRectangleF:2"] = TOLERANCE * 1.5f;
\r
2461 [Category("NotWorking")]
\r
2462 public override void DrawIconTest() {
\r
2463 base.DrawIconTest ();
\r
2467 [Category("NotWorking")]
\r
2468 public override void DrawIconUnstretchedTest() {
\r
2469 base.DrawIconUnstretchedTest ();
\r
2473 [Category("NotWorking")]
\r
2474 public override void DrawImageUnscaledTest() {
\r
2475 base.DrawImageUnscaledTest ();
\r
2479 public override void DrawStringFloatFormat() {
\r
2480 base.DrawStringFloatFormat ();
\r
2484 [Category("NotWorking")]
\r
2485 public override void MeasureCharacterRangesRegions() {
\r
2486 base.MeasureCharacterRangesRegions ();
\r
2490 [Category("NotWorking")]
\r
2491 public override void MeasureStringSizeFFormatInts() {
\r
2492 base.MeasureStringSizeFFormatInts ();
\r
2498 #region GraphicsFixturePropPageUnit
\r
2501 public class GraphicsFixturePropPageUnit1 : GraphicsFixture {
\r
2502 public override void SetUp() {
\r
2503 base.SetUp ("GraphicsFixturePropPageUnit1");
\r
2504 t.Graphics.PageUnit = GraphicsUnit.Display;
\r
2508 [Category("NotWorking")]
\r
2509 public override void DrawIconTest() {
\r
2510 base.DrawIconTest ();
\r
2514 [Category("NotWorking")]
\r
2515 public override void DrawIconUnstretchedTest() {
\r
2516 base.DrawIconUnstretchedTest ();
\r
2520 [Category("NotWorking")]
\r
2521 public override void DrawImageUnscaledTest() {
\r
2522 base.DrawImageUnscaledTest ();
\r
2526 [Category("NotWorking")]
\r
2527 public override void DrawStringFloatFormat() {
\r
2528 base.DrawStringFloatFormat ();
\r
2532 [Category("NotWorking")]
\r
2533 public override void MeasureCharacterRangesRegions() {
\r
2534 base.MeasureCharacterRangesRegions ();
\r
2538 [Category("NotWorking")]
\r
2539 public override void MeasureStringSizeFFormatInts() {
\r
2540 base.MeasureStringSizeFFormatInts ();
\r
2545 public class GraphicsFixturePropPageUnit2 : GraphicsFixture {
\r
2546 public override void SetUp() {
\r
2547 base.SetUp ("GraphicsFixturePropPageUnit2");
\r
2548 t.Graphics.PageUnit = GraphicsUnit.Document;
\r
2550 // FIXME: scaling down loss some pixels.
\r
2551 st["DrawBezierTest:2"] = TOLERANCE * 2.5f;
\r
2552 st["DrawBezierTest:4"] = TOLERANCE * 2.5f;
\r
2553 st["DrawBezierTest:6"] = TOLERANCE * 2.5f;
\r
2554 st["DrawBeziersTest:2"] = TOLERANCE * 2.0f;
\r
2555 st["DrawBeziersTest:4"] = TOLERANCE * 2.0f;
\r
2556 st["DrawClosedCurveTest:2"] = TOLERANCE * 3.0f;
\r
2557 st["DrawClosedCurveTest:4"] = TOLERANCE * 3.7f;
\r
2558 st["DrawCurveTest:2"] = TOLERANCE * 2.5f;
\r
2559 st["DrawCurveTest:4"] = TOLERANCE * 2.0f;
\r
2560 st["DrawCurveTest:6"] = TOLERANCE * 4.0f;
\r
2561 st["DrawCurveTestF:2"] = TOLERANCE * 2.5f;
\r
2562 st["DrawCurveTestF:4"] = TOLERANCE * 6.0f;
\r
2563 st["DrawCurveTestF:6"] = TOLERANCE * 6.0f;
\r
2564 st["DrawCurveTestF:8"] = TOLERANCE * 6.0f;
\r
2565 st["DrawEllipseTest:2"] = TOLERANCE * 2.0f;
\r
2566 st["DrawEllipseTest:4"] = TOLERANCE * 2.0f;
\r
2567 st["DrawEllipseTestF:2"] = TOLERANCE * 2.0f;
\r
2568 st["DrawEllipseTestF:4"] = TOLERANCE * 2.0f;
\r
2569 st["DrawLinesTest:2"] = TOLERANCE * 2.0f;
\r
2570 st["DrawLinesTestF:2"] = TOLERANCE * 2.0f;
\r
2571 st["DrawPathTest:2"] = TOLERANCE * 2.0f;
\r
2572 st["DrawPolygonPoint:2"] = TOLERANCE * 7.0f;
\r
2573 st["DrawPolygonPointF:2"] = TOLERANCE * 7.0f;
\r
2574 st["FillPieFloat:2"] = TOLERANCE * 1.5f;
\r
2575 st["FillPieFloat:4"] = TOLERANCE * 1.5f;
\r
2576 st["FillPieFloat:6"] = TOLERANCE * 1.5f;
\r
2577 st["IntersectClipRegion:4"] = TOLERANCE * 3.0f;
\r
2578 st["MultiplyTransform:2"] = TOLERANCE * 2.5f;
\r
2579 st["MultiplyTransformMatrixOrder1:2"] = TOLERANCE * 2.5f;
\r
2580 st["TranslateTransformAngleMatrixOrder1:2"] = TOLERANCE * 4.0f;
\r
2581 st["ScaleTransformFloatMatrixOrder:2"] = TOLERANCE * 4.0f;
\r
2582 st["ScaleTransformFloatMatrixOrder1:2"] = TOLERANCE * 5.5f;
\r
2583 st["RotateTransformAngleMatrixOrder:2"] = TOLERANCE * 3.5f;
\r
2587 [Category("NotWorking")]
\r
2588 public override void BeginContainerTest() {
\r
2589 base.BeginContainerTest ();
\r
2593 [Category("NotWorking")]
\r
2594 public override void DrawIconTest() {
\r
2595 base.DrawIconTest ();
\r
2599 [Category("NotWorking")]
\r
2600 public override void DrawIconUnstretchedTest() {
\r
2601 base.DrawIconUnstretchedTest ();
\r
2605 [Category("NotWorking")]
\r
2606 public override void DrawImageUnscaledTest() {
\r
2607 base.DrawImageUnscaledTest ();
\r
2611 [Category("NotWorking")]
\r
2612 public override void DrawStringFloatFormat() {
\r
2613 base.DrawStringFloatFormat ();
\r
2617 [Category("NotWorking")]
\r
2618 public override void EndContainerState() {
\r
2619 base.EndContainerState ();
\r
2623 [Category("NotWorking")]
\r
2624 public override void MeasureCharacterRangesRegions() {
\r
2625 base.MeasureCharacterRangesRegions ();
\r
2629 [Category("NotWorking")]
\r
2630 public override void MeasureStringSizeFFormatInts() {
\r
2631 base.MeasureStringSizeFFormatInts ();
\r
2636 public class GraphicsFixturePropPageUnit3 : GraphicsFixture {
\r
2637 public override void SetUp() {
\r
2638 base.SetUp ("GraphicsFixturePropPageUnit3");
\r
2639 t.Graphics.PageUnit = GraphicsUnit.Inch;
\r
2643 [Category("NotWorking")]
\r
2644 public override void DrawIconTest() {
\r
2645 base.DrawIconTest ();
\r
2649 [Category("NotWorking")]
\r
2650 public override void DrawIconUnstretchedTest() {
\r
2651 base.DrawIconUnstretchedTest ();
\r
2655 public override void DrawImageUnscaledTest() {
\r
2656 base.DrawImageUnscaledTest ();
\r
2660 public override void DrawStringFloatFormat() {
\r
2661 base.DrawStringFloatFormat ();
\r
2665 [Category("NotWorking")]
\r
2666 public override void IsVisible4Float() {
\r
2667 base.IsVisible4Float ();
\r
2671 public override void MeasureCharacterRangesRegions() {
\r
2672 base.MeasureCharacterRangesRegions ();
\r
2676 [Category("NotWorking")]
\r
2677 public override void MeasureStringSizeFFormatInts() {
\r
2678 base.MeasureStringSizeFFormatInts ();
\r
2683 public class GraphicsFixturePropPageUnit4 : GraphicsFixture {
\r
2684 public override void SetUp() {
\r
2685 base.SetUp ("GraphicsFixturePropPageUnit4");
\r
2686 t.Graphics.PageUnit = GraphicsUnit.Millimeter;
\r
2688 st["DrawArcTest:8"] = TOLERANCE * 1.5f;
\r
2689 st["DrawRectangleFloat:2"] = TOLERANCE * 1.5f; // line width problem
\r
2690 st["DrawRectangleFloat:4"] = TOLERANCE * 1.5f;
\r
2691 st["DrawRectangleFloat:6"] = TOLERANCE * 1.5f;
\r
2692 st["DrawRectanglesRectangle:2"] = TOLERANCE * 1.5f;
\r
2693 st["DrawRectanglesRectangleF:2"] = TOLERANCE * 1.5f;
\r
2697 [Category("NotWorking")]
\r
2698 public override void DrawClosedCurveTest() {
\r
2699 base.DrawClosedCurveTest ();
\r
2703 [Category("NotWorking")]
\r
2704 public override void DrawIconTest() {
\r
2705 base.DrawIconTest ();
\r
2709 [Category("NotWorking")]
\r
2710 public override void DrawIconUnstretchedTest() {
\r
2711 base.DrawIconUnstretchedTest ();
\r
2715 [Category("NotWorking")]
\r
2716 public override void DrawImageUnscaledTest() {
\r
2717 base.DrawImageUnscaledTest ();
\r
2721 public override void DrawStringFloatFormat() {
\r
2722 base.DrawStringFloatFormat ();
\r
2726 [Category("NotWorking")]
\r
2727 public override void MeasureCharacterRangesRegions() {
\r
2728 base.MeasureCharacterRangesRegions ();
\r
2732 [Category("NotWorking")]
\r
2733 public override void MeasureStringSizeFFormatInts() {
\r
2734 base.MeasureStringSizeFFormatInts ();
\r
2739 public class GraphicsFixturePropPageUnit5 : GraphicsFixture {
\r
2740 public override void SetUp() {
\r
2741 base.SetUp ("GraphicsFixturePropPageUnit5");
\r
2743 t.Graphics.PageUnit = GraphicsUnit.Pixel;
\r
2747 [Category("NotWorking")]
\r
2748 public override void DrawIconTest() {
\r
2749 base.DrawIconTest ();
\r
2753 [Category("NotWorking")]
\r
2754 public override void DrawIconUnstretchedTest() {
\r
2755 base.DrawIconUnstretchedTest ();
\r
2759 [Category("NotWorking")]
\r
2760 public override void DrawImageUnscaledTest() {
\r
2761 base.DrawImageUnscaledTest ();
\r
2765 [Category("NotWorking")]
\r
2766 public override void DrawStringFloatFormat() {
\r
2767 base.DrawStringFloatFormat ();
\r
2771 [Category("NotWorking")]
\r
2772 public override void MeasureCharacterRangesRegions() {
\r
2773 base.MeasureCharacterRangesRegions ();
\r
2777 [Category("NotWorking")]
\r
2778 public override void MeasureStringSizeFFormatInts() {
\r
2779 base.MeasureStringSizeFFormatInts ();
\r
2784 public class GraphicsFixturePropPageUnit6 : GraphicsFixture {
\r
2785 public override void SetUp() {
\r
2786 base.SetUp ("GraphicsFixturePropPageUnit6");
\r
2787 t.Graphics.PageUnit = GraphicsUnit.Point;
\r
2789 st["DrawArcTest:2"] = TOLERANCE * 2.5f;
\r
2790 st["DrawArcTest:4"] = TOLERANCE * 8.0f; // big difference in width of line
\r
2791 st["DrawArcTest:6"] = TOLERANCE * 8.0f; // big difference in width of line
\r
2792 st["DrawArcTest:8"] = TOLERANCE * 6.0f; // big difference in width of line
\r
2793 st["IsVisible4Float:2"] = TOLERANCE * 1.5f;
\r
2794 st["TransformPointsPointF:2"] = TOLERANCE * 2.0f;
\r
2798 [Category("NotWorking")]
\r
2799 public override void DrawClosedCurveTest() {
\r
2800 base.DrawClosedCurveTest ();
\r
2804 [Category("NotWorking")]
\r
2805 public override void DrawCurveTest() {
\r
2806 base.DrawCurveTest ();
\r
2810 [Category("NotWorking")]
\r
2811 public override void DrawCurveTestF() {
\r
2812 base.DrawCurveTestF ();
\r
2816 [Category("NotWorking")]
\r
2817 public override void DrawEllipseTest() {
\r
2818 base.DrawEllipseTest ();
\r
2822 [Category("NotWorking")]
\r
2823 public override void DrawEllipseTestF() {
\r
2824 base.DrawEllipseTestF ();
\r
2828 [Category("NotWorking")]
\r
2829 public override void DrawIconTest() {
\r
2830 base.DrawIconTest ();
\r
2834 [Category("NotWorking")]
\r
2835 public override void DrawIconUnstretchedTest() {
\r
2836 base.DrawIconUnstretchedTest ();
\r
2840 [Category("NotWorking")]
\r
2841 public override void DrawImageUnscaledTest() {
\r
2842 base.DrawImageUnscaledTest ();
\r
2846 [Category("NotWorking")]
\r
2847 public override void DrawPathTest() {
\r
2848 base.DrawPathTest ();
\r
2852 [Category("NotWorking")]
\r
2853 public override void DrawStringFloatFormat() {
\r
2854 base.DrawStringFloatFormat ();
\r
2858 [Category("NotWorking")]
\r
2859 public override void EndContainerState() {
\r
2860 base.EndContainerState ();
\r
2864 [Category("NotWorking")]
\r
2865 public override void MeasureCharacterRangesRegions() {
\r
2866 base.MeasureCharacterRangesRegions ();
\r
2870 [Category("NotWorking")]
\r
2871 public override void MeasureStringSizeFFormatInts() {
\r
2872 base.MeasureStringSizeFFormatInts ();
\r
2876 [Category("NotWorking")]
\r
2877 public override void MultiplyTransform() {
\r
2878 base.MultiplyTransform ();
\r
2882 [Category("NotWorking")]
\r
2883 public override void MultiplyTransformMatrixOrder1() {
\r
2884 base.MultiplyTransformMatrixOrder1 ();
\r
2888 [Category("NotWorking")]
\r
2889 public override void RotateTransformAngleMatrixOrder1() {
\r
2890 base.RotateTransformAngleMatrixOrder1 ();
\r
2894 [Category("NotWorking")]
\r
2895 public override void TranslateTransformAngleMatrixOrder() {
\r
2896 base.TranslateTransformAngleMatrixOrder ();
\r
2901 // public class GraphicsFixturePropPageUnit7 : GraphicsFixture {
\r
2902 // public override void SetUp() {
\r
2905 // t.Graphics.PageUnit = GraphicsUnit.World;
\r
2911 #region GraphicsFixturePropPixelOffsetMode
\r
2914 public class GraphicsFixturePropPixelOffsetMode : GraphicsFixture {
\r
2915 public override void SetUp() {
\r
2916 base.SetUp ("GraphicsFixturePropPixelOffsetMode");
\r
2917 t.Graphics.PixelOffsetMode = PixelOffsetMode.Half;
\r
2919 st["TransformPointsPointF:2"] = TOLERANCE * 3.0f;
\r
2923 [Category("NotWorking")]
\r
2924 public override void DrawIconTest() {
\r
2925 base.DrawIconTest ();
\r
2929 [Category("NotWorking")]
\r
2930 public override void DrawIconUnstretchedTest() {
\r
2931 base.DrawIconUnstretchedTest ();
\r
2935 [Category("NotWorking")]
\r
2936 public override void DrawImageUnscaledTest() {
\r
2937 base.DrawImageUnscaledTest ();
\r
2941 [Category("NotWorking")]
\r
2942 public override void DrawStringFloatFormat() {
\r
2943 base.DrawStringFloatFormat ();
\r
2947 [Category("NotWorking")]
\r
2948 public override void MeasureCharacterRangesRegions() {
\r
2949 base.MeasureCharacterRangesRegions ();
\r
2953 [Category("NotWorking")]
\r
2954 public override void MeasureStringSizeFFormatInts() {
\r
2955 base.MeasureStringSizeFFormatInts ();
\r
2960 public class GraphicsFixturePropPixelOffsetMode1 : GraphicsFixture {
\r
2961 public override void SetUp() {
\r
2962 base.SetUp ("GraphicsFixturePropPixelOffsetMode1");
\r
2963 t.Graphics.PixelOffsetMode = PixelOffsetMode.HighSpeed;
\r
2967 [Category("NotWorking")]
\r
2968 public override void DrawIconTest() {
\r
2969 base.DrawIconTest ();
\r
2973 [Category("NotWorking")]
\r
2974 public override void DrawIconUnstretchedTest() {
\r
2975 base.DrawIconUnstretchedTest ();
\r
2979 [Category("NotWorking")]
\r
2980 public override void DrawImageUnscaledTest() {
\r
2981 base.DrawImageUnscaledTest ();
\r
2985 [Category("NotWorking")]
\r
2986 public override void DrawStringFloatFormat() {
\r
2987 base.DrawStringFloatFormat ();
\r
2991 [Category("NotWorking")]
\r
2992 public override void MeasureCharacterRangesRegions() {
\r
2993 base.MeasureCharacterRangesRegions ();
\r
2997 [Category("NotWorking")]
\r
2998 public override void MeasureStringSizeFFormatInts() {
\r
2999 base.MeasureStringSizeFFormatInts ();
\r
3004 public class GraphicsFixturePropPixelOffsetMode2 : GraphicsFixture {
\r
3005 public override void SetUp() {
\r
3006 base.SetUp ("GraphicsFixturePropPixelOffsetMode2");
\r
3007 t.Graphics.PixelOffsetMode = PixelOffsetMode.HighQuality;
\r
3009 st["TransformPointsPointF:2"] = TOLERANCE * 3.0f;
\r
3013 [Category("NotWorking")]
\r
3014 public override void DrawIconTest() {
\r
3015 base.DrawIconTest ();
\r
3019 [Category("NotWorking")]
\r
3020 public override void DrawIconUnstretchedTest() {
\r
3021 base.DrawIconUnstretchedTest ();
\r
3025 [Category("NotWorking")]
\r
3026 public override void DrawImageUnscaledTest() {
\r
3027 base.DrawImageUnscaledTest ();
\r
3031 [Category("NotWorking")]
\r
3032 public override void DrawStringFloatFormat() {
\r
3033 base.DrawStringFloatFormat ();
\r
3037 [Category("NotWorking")]
\r
3038 public override void MeasureCharacterRangesRegions() {
\r
3039 base.MeasureCharacterRangesRegions ();
\r
3043 [Category("NotWorking")]
\r
3044 public override void MeasureStringSizeFFormatInts() {
\r
3045 base.MeasureStringSizeFFormatInts ();
\r
3051 #region GraphicsFixturePropRenderingOrigin
\r
3054 [Category("NotWorking")]
\r
3055 public class GraphicsFixturePropRenderingOrigin : GraphicsFixture {
\r
3056 public override void SetUp() {
\r
3057 base.SetUp ("GraphicsFixturePropRenderingOrigin");
\r
3058 t.Graphics.RenderingOrigin = new Point(12, 23);
\r
3062 [Category("NotWorking")]
\r
3063 public override void BeginContainerTest() {
\r
3064 base.BeginContainerTest ();
\r
3068 [Category("NotWorking")]
\r
3069 public override void BeginContainerTest_2() {
\r
3070 base.BeginContainerTest_2 ();
\r
3074 [Category("NotWorking")]
\r
3075 public override void ClearTest() {
\r
3076 base.ClearTest ();
\r
3080 [Category("NotWorking")]
\r
3081 public override void DrawArcTest() {
\r
3082 base.DrawArcTest ();
\r
3086 [Category("NotWorking")]
\r
3087 public override void DrawBezierTest() {
\r
3088 base.DrawBezierTest ();
\r
3092 [Category("NotWorking")]
\r
3093 public override void DrawBeziersTest() {
\r
3094 base.DrawBeziersTest ();
\r
3098 [Category("NotWorking")]
\r
3099 public override void DrawClosedCurveTest() {
\r
3100 base.DrawClosedCurveTest ();
\r
3104 [Category("NotWorking")]
\r
3105 public override void DrawCurveTest() {
\r
3106 base.DrawCurveTest ();
\r
3110 [Category("NotWorking")]
\r
3111 public override void DrawCurveTestF() {
\r
3112 base.DrawCurveTestF ();
\r
3116 [Category("NotWorking")]
\r
3117 public override void DrawEllipseTest() {
\r
3118 base.DrawEllipseTest ();
\r
3122 [Category("NotWorking")]
\r
3123 public override void DrawEllipseTestF() {
\r
3124 base.DrawEllipseTestF ();
\r
3128 [Category("NotWorking")]
\r
3129 public override void DrawIconTest() {
\r
3130 base.DrawIconTest ();
\r
3134 [Category("NotWorking")]
\r
3135 public override void DrawIconUnstretchedTest() {
\r
3136 base.DrawIconUnstretchedTest ();
\r
3140 [Category("NotWorking")]
\r
3141 public override void DrawImageUnscaledTest() {
\r
3142 base.DrawImageUnscaledTest ();
\r
3146 [Category("NotWorking")]
\r
3147 public override void DrawLineTest() {
\r
3148 base.DrawLineTest ();
\r
3152 [Category("NotWorking")]
\r
3153 public override void DrawLineTestF() {
\r
3154 base.DrawLineTestF ();
\r
3158 [Category("NotWorking")]
\r
3159 public override void DrawLinesTest() {
\r
3160 base.DrawLinesTest ();
\r
3164 [Category("NotWorking")]
\r
3165 public override void DrawLinesTestF() {
\r
3166 base.DrawLinesTestF ();
\r
3170 [Category("NotWorking")]
\r
3171 public override void DrawPathTest() {
\r
3172 base.DrawPathTest ();
\r
3176 [Category("NotWorking")]
\r
3177 public override void DrawPieTestF() {
\r
3178 base.DrawPieTestF ();
\r
3182 [Category("NotWorking")]
\r
3183 public override void DrawPieTest() {
\r
3184 base.DrawPieTest ();
\r
3188 [Category("NotWorking")]
\r
3189 public override void DrawPolygonPoint() {
\r
3190 base.DrawPolygonPoint ();
\r
3194 [Category("NotWorking")]
\r
3195 public override void DrawPolygonPointF() {
\r
3196 base.DrawPolygonPointF ();
\r
3200 [Category("NotWorking")]
\r
3201 public override void DrawRectangleFloat() {
\r
3202 base.DrawRectangleFloat ();
\r
3206 [Category("NotWorking")]
\r
3207 public override void DrawRectanglesRectangleF() {
\r
3208 base.DrawRectanglesRectangleF ();
\r
3212 [Category("NotWorking")]
\r
3213 public override void DrawRectanglesRectangle() {
\r
3214 base.DrawRectanglesRectangle ();
\r
3218 [Category("NotWorking")]
\r
3219 public override void DrawStringFloatFormat() {
\r
3220 base.DrawStringFloatFormat ();
\r
3224 [Category("NotWorking")]
\r
3225 public override void EndContainerState() {
\r
3226 base.EndContainerState ();
\r
3230 [Category("NotWorking")]
\r
3231 public override void EnumerateMetafile() {
\r
3232 base.EnumerateMetafile ();
\r
3236 [Category("NotWorking")]
\r
3237 public override void ExcludeClipRegion() {
\r
3238 base.ExcludeClipRegion ();
\r
3242 [Category("NotWorking")]
\r
3243 public override void FillClosedCurvePointFillModeTension() {
\r
3244 base.FillClosedCurvePointFillModeTension ();
\r
3248 [Category("NotWorking")]
\r
3249 public override void FillClosedCurvePointFFillModeTension() {
\r
3250 base.FillClosedCurvePointFFillModeTension ();
\r
3254 [Category("NotWorking")]
\r
3255 public override void FillEllipse() {
\r
3256 base.FillEllipse ();
\r
3260 [Category("NotWorking")]
\r
3261 public override void FillEllipseFloat() {
\r
3262 base.FillEllipseFloat ();
\r
3266 [Category("NotWorking")]
\r
3267 public override void FillPathEllipse() {
\r
3268 base.FillPathEllipse ();
\r
3272 [Category("NotWorking")]
\r
3273 public override void FillPieFloat() {
\r
3274 base.FillPieFloat ();
\r
3278 [Category("NotWorking")]
\r
3279 public override void FillPolygonPointFillMode() {
\r
3280 base.FillPolygonPointFillMode ();
\r
3284 [Category("NotWorking")]
\r
3285 public override void FillPolygonPointFFillMode() {
\r
3286 base.FillPolygonPointFFillMode ();
\r
3290 [Category("NotWorking")]
\r
3291 public override void FillRectangle() {
\r
3292 base.FillRectangle ();
\r
3296 [Category("NotWorking")]
\r
3297 public override void FillRectangleFloat() {
\r
3298 base.FillRectangleFloat ();
\r
3302 [Category("NotWorking")]
\r
3303 public override void FillRectanglesRectangle() {
\r
3304 base.FillRectanglesRectangle ();
\r
3308 [Category("NotWorking")]
\r
3309 public override void FillRectanglesRectangleF() {
\r
3310 base.FillRectanglesRectangleF ();
\r
3314 [Category("NotWorking")]
\r
3315 public override void FillRegionRectangle() {
\r
3316 base.FillRegionRectangle ();
\r
3320 [Category("NotWorking")]
\r
3321 public override void FlushTest() {
\r
3322 base.FlushTest ();
\r
3326 [Category("NotWorking")]
\r
3327 public override void IsVisible4Float() {
\r
3328 base.IsVisible4Float ();
\r
3332 [Category("NotWorking")]
\r
3333 public override void MeasureCharacterRangesRegions() {
\r
3334 base.MeasureCharacterRangesRegions ();
\r
3338 [Category("NotWorking")]
\r
3339 public override void MeasureStringSizeFFormatInts() {
\r
3340 base.MeasureStringSizeFFormatInts ();
\r
3344 [Category("NotWorking")]
\r
3345 public override void MultiplyTransform() {
\r
3346 base.MultiplyTransform ();
\r
3350 [Category("NotWorking")]
\r
3351 public override void MultiplyTransformMatrixOrder() {
\r
3352 base.MultiplyTransformMatrixOrder ();
\r
3356 [Category("NotWorking")]
\r
3357 public override void MultiplyTransformMatrixOrder1() {
\r
3358 base.MultiplyTransformMatrixOrder1 ();
\r
3362 [Category("NotWorking")]
\r
3363 public override void ResetClipIntersectClipRectangleF() {
\r
3364 base.ResetClipIntersectClipRectangleF ();
\r
3368 [Category("NotWorking")]
\r
3369 public override void SaveRestoreTranslate() {
\r
3370 base.SaveRestoreTranslate ();
\r
3374 [Category("NotWorking")]
\r
3375 public override void RotateTransformAngleMatrixOrder() {
\r
3376 base.RotateTransformAngleMatrixOrder ();
\r
3380 [Category("NotWorking")]
\r
3381 public override void RotateTransformAngleMatrixOrder1() {
\r
3382 base.RotateTransformAngleMatrixOrder1 ();
\r
3386 [Category("NotWorking")]
\r
3387 public override void ScaleTransformFloatMatrixOrder() {
\r
3388 base.ScaleTransformFloatMatrixOrder ();
\r
3392 [Category("NotWorking")]
\r
3393 public override void ScaleTransformFloatMatrixOrder1() {
\r
3394 base.ScaleTransformFloatMatrixOrder1 ();
\r
3398 [Category("NotWorking")]
\r
3399 public override void SetClipRegionCombine() {
\r
3400 base.SetClipRegionCombine ();
\r
3404 [Category("NotWorking")]
\r
3405 public override void TransformPointsPointF() {
\r
3406 base.TransformPointsPointF ();
\r
3410 [Category("NotWorking")]
\r
3411 public override void TranslateClipFloat() {
\r
3412 base.TranslateClipFloat ();
\r
3416 [Category("NotWorking")]
\r
3417 public override void TranslateTransformAngleMatrixOrder() {
\r
3418 base.TranslateTransformAngleMatrixOrder ();
\r
3422 [Category("NotWorking")]
\r
3423 public override void TranslateTransformAngleMatrixOrder1() {
\r
3424 base.TranslateTransformAngleMatrixOrder1 ();
\r
3428 [Category("NotWorking")]
\r
3429 public override void TransfromPageScaleUnits() {
\r
3430 base.TransfromPageScaleUnits ();
\r
3434 [Category("NotWorking")]
\r
3435 public override void TransfromPageScaleUnits_2() {
\r
3436 base.TransfromPageScaleUnits_2 ();
\r
3440 [Category("NotWorking")]
\r
3441 public override void TransfromPageScaleUnits_3() {
\r
3442 base.TransfromPageScaleUnits_3 ();
\r
3449 /// TBD: add more variants
\r
3451 #region GraphicsFixturePropSmoothingMode
\r
3454 public class GraphicsFixturePropSmoothingMode : GraphicsFixture {
\r
3455 public override void SetUp() {
\r
3456 base.SetUp ("GraphicsFixturePropSmoothingMode");
\r
3457 t.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
\r
3459 st["DrawArcTest:4"] = TOLERANCE * 3.0f;
\r
3460 st["DrawLineTest:2"] = TOLERANCE * 3.0f;
\r
3461 st["DrawLineTest:4"] = TOLERANCE * 3.0f; // difference in line width even in horizontal lines
\r
3462 st["DrawLineTestF:2"] = TOLERANCE * 3.0f;
\r
3463 st["DrawLineTestF:4"] = TOLERANCE * 3.0f;
\r
3464 st["DrawPieTest:2"] = TOLERANCE * 1.5f;
\r
3465 st["DrawPieTestF:2"] = TOLERANCE * 1.5f;
\r
3466 st["DrawPieTest:4"] = TOLERANCE * 1.5f;
\r
3467 st["DrawPieTestF:4"] = TOLERANCE * 1.5f;
\r
3468 st["DrawRectangleFloat:2"] = TOLERANCE * 3.0f; // big difference in line width
\r
3469 st["DrawRectangleFloat:4"] = TOLERANCE * 3.0f; // big difference in line width
\r
3470 st["DrawRectangleFloat:6"] = TOLERANCE * 3.0f;
\r
3471 st["DrawRectanglesRectangle:2"] = TOLERANCE * 3.0f;
\r
3472 st["DrawRectanglesRectangleF:2"] = TOLERANCE * 3.0f;
\r
3476 [Category("NotWorking")]
\r
3477 public override void DrawIconTest() {
\r
3478 base.DrawIconTest ();
\r
3482 [Category("NotWorking")]
\r
3483 public override void DrawIconUnstretchedTest() {
\r
3484 base.DrawIconUnstretchedTest ();
\r
3488 [Category("NotWorking")]
\r
3489 public override void DrawImageUnscaledTest() {
\r
3490 base.DrawImageUnscaledTest ();
\r
3494 [Category("NotWorking")]
\r
3495 public override void DrawStringFloatFormat() {
\r
3496 base.DrawStringFloatFormat ();
\r
3500 [Category("NotWorking")]
\r
3501 public override void MeasureCharacterRangesRegions() {
\r
3502 base.MeasureCharacterRangesRegions ();
\r
3506 [Category("NotWorking")]
\r
3507 public override void MeasureStringSizeFFormatInts() {
\r
3508 base.MeasureStringSizeFFormatInts ();
\r
3513 public class GraphicsFixturePropSmoothingMode1 : GraphicsFixture {
\r
3514 public override void SetUp() {
\r
3515 base.SetUp ("GraphicsFixturePropSmoothingMode1");
\r
3516 t.Graphics.SmoothingMode = SmoothingMode.HighSpeed;
\r
3520 [Category("NotWorking")]
\r
3521 public override void DrawIconTest() {
\r
3522 base.DrawIconTest ();
\r
3526 [Category("NotWorking")]
\r
3527 public override void DrawIconUnstretchedTest() {
\r
3528 base.DrawIconUnstretchedTest ();
\r
3532 [Category("NotWorking")]
\r
3533 public override void DrawImageUnscaledTest() {
\r
3534 base.DrawImageUnscaledTest ();
\r
3538 [Category("NotWorking")]
\r
3539 public override void DrawStringFloatFormat() {
\r
3540 base.DrawStringFloatFormat ();
\r
3544 [Category("NotWorking")]
\r
3545 public override void MeasureCharacterRangesRegions() {
\r
3546 base.MeasureCharacterRangesRegions ();
\r
3550 [Category("NotWorking")]
\r
3551 public override void MeasureStringSizeFFormatInts() {
\r
3552 base.MeasureStringSizeFFormatInts ();
\r
3558 #region GraphicsFixturePropTextContrast
\r
3561 public class GraphicsFixturePropTextContrast : GraphicsFixture {
\r
3562 public override void SetUp() {
\r
3563 base.SetUp ("GraphicsFixturePropTextContrast");
\r
3564 t.Graphics.TextContrast = 9;
\r
3568 [Category("NotWorking")]
\r
3569 public override void DrawIconTest() {
\r
3570 base.DrawIconTest ();
\r
3574 [Category("NotWorking")]
\r
3575 public override void DrawIconUnstretchedTest() {
\r
3576 base.DrawIconUnstretchedTest ();
\r
3580 [Category("NotWorking")]
\r
3581 public override void DrawImageUnscaledTest() {
\r
3582 base.DrawImageUnscaledTest ();
\r
3586 [Category("NotWorking")]
\r
3587 public override void DrawStringFloatFormat() {
\r
3588 base.DrawStringFloatFormat ();
\r
3592 [Category("NotWorking")]
\r
3593 public override void MeasureCharacterRangesRegions() {
\r
3594 base.MeasureCharacterRangesRegions ();
\r
3598 [Category("NotWorking")]
\r
3599 public override void MeasureStringSizeFFormatInts() {
\r
3600 base.MeasureStringSizeFFormatInts ();
\r
3606 #region GraphicsFixtureGraphicsState
\r
3609 public class GraphicsFixtureGraphicsState {
\r
3610 protected DrawingTest t;
\r
3611 protected int TOLERANCE = 3; //in %;
\r
3614 public virtual void SetUp() {
\r
3615 t = DrawingTest.Create(512, 512, "GraphicsFixtureGraphicsState");
\r
3619 public void TearDown ()
\r
3626 public void BeginEndContainer() {
\r
3627 t.Graphics.FillRectangle( Brushes.Blue, 0, 0, 100, 100 );
\r
3629 GraphicsContainer c1 = t.Graphics.BeginContainer(
\r
3630 new Rectangle(100, 100, 100, 100),
\r
3631 new Rectangle(0, 0, 100, 100),
\r
3632 GraphicsUnit.Pixel);
\r
3634 t.Graphics.FillRectangle( Brushes.Green, 0, 0, 100, 100 );
\r
3636 GraphicsContainer c2 = t.Graphics.BeginContainer(
\r
3637 new Rectangle(100, 100, 100, 100),
\r
3638 new Rectangle(0, 0, 100, 100),
\r
3639 GraphicsUnit.Pixel);
\r
3641 t.Graphics.FillRectangle( Brushes.Red, 0, 0, 100, 100 );
\r
3643 GraphicsState s1 = t.Graphics.Save();
\r
3644 t.Graphics.PageUnit = GraphicsUnit.Pixel;
\r
3646 t.Graphics.PageScale = 0.7f;
\r
3647 t.Graphics.FillRectangle( Brushes.SeaGreen, 0, 0, 100, 100 );
\r
3649 t.Graphics.EndContainer(c2);
\r
3650 t.Graphics.PageScale = 0.7f;
\r
3651 t.Graphics.FillRectangle( Brushes.SeaGreen, 0, 0, 100, 100 );
\r
3653 t.Graphics.EndContainer(c1);
\r
3654 t.Graphics.PageScale = 0.7f;
\r
3655 t.Graphics.FillRectangle( Brushes.SeaGreen, 0, 0, 100, 100 );
\r
3658 Assert.IsTrue(t.PDCompare());
\r
3662 public void SaveRestoreGraphicsProps() {
\r
3663 t.Graphics.CompositingQuality = CompositingQuality.GammaCorrected;
\r
3664 t.Graphics.CompositingMode = CompositingMode.SourceCopy;
\r
3665 t.Graphics.InterpolationMode = InterpolationMode.NearestNeighbor;
\r
3666 t.Graphics.PageScale = 7;
\r
3667 t.Graphics.PageUnit = GraphicsUnit.Inch;
\r
3668 t.Graphics.PixelOffsetMode = PixelOffsetMode.Half;
\r
3669 t.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
\r
3670 t.Graphics.Transform = new Matrix(1, 2, 3, 4, 5, 6);
\r
3671 t.Graphics.TextContrast = 10;
\r
3672 t.Graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
\r
3674 GraphicsContainer c1 = t.Graphics.BeginContainer();
\r
3676 Assert.AreEqual(CompositingQuality.Default, t.Graphics.CompositingQuality);
\r
3677 Assert.AreEqual(CompositingMode.SourceOver, t.Graphics.CompositingMode);
\r
3678 Assert.AreEqual(InterpolationMode.Bilinear, t.Graphics.InterpolationMode);
\r
3679 Assert.AreEqual(1.0F, t.Graphics.PageScale);
\r
3680 Assert.AreEqual(GraphicsUnit.Display, t.Graphics.PageUnit);
\r
3681 Assert.AreEqual(PixelOffsetMode.Default, t.Graphics.PixelOffsetMode);
\r
3682 Assert.AreEqual(SmoothingMode.None, t.Graphics.SmoothingMode);
\r
3683 Assert.AreEqual(true, t.Graphics.Transform.IsIdentity);
\r
3684 Assert.AreEqual(4.0f, t.Graphics.TextContrast);
\r
3685 Assert.AreEqual(TextRenderingHint.SystemDefault, t.Graphics.TextRenderingHint);
\r
3687 t.Graphics.EndContainer(c1);
\r
3690 public void SaveRestoreGraphicsProps_2() {
\r
3691 GraphicsState s = t.Graphics.Save();
\r
3693 t.Graphics.CompositingQuality = CompositingQuality.GammaCorrected;
\r
3694 t.Graphics.CompositingMode = CompositingMode.SourceCopy;
\r
3695 t.Graphics.InterpolationMode = InterpolationMode.NearestNeighbor;
\r
3696 t.Graphics.PageScale = 7;
\r
3697 t.Graphics.PageUnit = GraphicsUnit.Inch;
\r
3698 t.Graphics.PixelOffsetMode = PixelOffsetMode.Half;
\r
3699 t.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
\r
3700 t.Graphics.Transform = new Matrix(1, 2, 3, 4, 5, 6);
\r
3701 t.Graphics.TextContrast = 10;
\r
3702 t.Graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
\r
3704 t.Graphics.Restore(s);
\r
3706 Assert.AreEqual(CompositingQuality.Default, t.Graphics.CompositingQuality);
\r
3707 Assert.AreEqual(CompositingMode.SourceOver, t.Graphics.CompositingMode);
\r
3708 Assert.AreEqual(InterpolationMode.Bilinear, t.Graphics.InterpolationMode);
\r
3709 Assert.AreEqual(1.0F, t.Graphics.PageScale);
\r
3710 Assert.AreEqual(GraphicsUnit.Display, t.Graphics.PageUnit);
\r
3711 Assert.AreEqual(PixelOffsetMode.Default, t.Graphics.PixelOffsetMode);
\r
3712 Assert.AreEqual(SmoothingMode.None, t.Graphics.SmoothingMode);
\r
3713 Assert.AreEqual(true, t.Graphics.Transform.IsIdentity);
\r
3714 Assert.AreEqual(4.0f, t.Graphics.TextContrast);
\r
3715 Assert.AreEqual(TextRenderingHint.SystemDefault, t.Graphics.TextRenderingHint);
\r
3719 public void SaveRestoreGraphicsProps_3() {
\r
3720 t.Graphics.PageScale = 2;
\r
3721 GraphicsContainer c1 = t.Graphics.BeginContainer();
\r
3723 t.Graphics.PageScale = 3;
\r
3724 GraphicsContainer c2 = t.Graphics.BeginContainer();
\r
3726 t.Graphics.PageScale = 4;
\r
3727 GraphicsContainer c3 = t.Graphics.BeginContainer();
\r
3729 t.Graphics.EndContainer(c2);
\r
3730 Assert.AreEqual(3, t.Graphics.PageScale);
\r
3732 t.Graphics.PageScale = 5;
\r
3733 GraphicsState c5 = t.Graphics.Save();
\r
3735 t.Graphics.EndContainer(c3);
\r
3736 Assert.AreEqual(5, t.Graphics.PageScale);
\r
3738 t.Graphics.Restore(c5);
\r
3739 Assert.AreEqual(5, t.Graphics.PageScale);
\r
3741 t.Graphics.EndContainer(c1);
\r
3742 Assert.AreEqual(2, t.Graphics.PageScale);
\r
3745 public void SaveRestoreGraphicsProps_4() {
\r
3746 t.Graphics.PageScale = 2;
\r
3747 GraphicsContainer c1 = t.Graphics.BeginContainer();
\r
3749 t.Graphics.PageScale = 3;
\r
3750 GraphicsState c2 = t.Graphics.Save();
\r
3752 t.Graphics.EndContainer(c1);
\r
3753 Assert.AreEqual(2, t.Graphics.PageScale);
\r
3755 t.Graphics.Restore(c2);
\r
3756 Assert.AreEqual(2, t.Graphics.PageScale);
\r
3761 #region GraphicsFixturePropTextRenderingHint
\r
3764 public class GraphicsFixturePropTextRenderingHint : GraphicsFixture {
\r
3765 public override void SetUp() {
\r
3766 base.SetUp ("GraphicsFixturePropTextRenderingHint");
\r
3767 t.Graphics.TextRenderingHint = TextRenderingHint.AntiAlias;
\r
3771 [Category("NotWorking")]
\r
3772 public override void DrawIconTest() {
\r
3773 base.DrawIconTest ();
\r
3777 [Category("NotWorking")]
\r
3778 public override void DrawIconUnstretchedTest() {
\r
3779 base.DrawIconUnstretchedTest ();
\r
3783 [Category("NotWorking")]
\r
3784 public override void DrawImageUnscaledTest() {
\r
3785 base.DrawImageUnscaledTest ();
\r
3789 [Category("NotWorking")]
\r
3790 public override void DrawStringFloatFormat() {
\r
3791 base.DrawStringFloatFormat ();
\r
3795 [Category("NotWorking")]
\r
3796 public override void MeasureCharacterRangesRegions() {
\r
3797 base.MeasureCharacterRangesRegions ();
\r
3801 [Category("NotWorking")]
\r
3802 public override void MeasureStringSizeFFormatInts() {
\r
3803 base.MeasureStringSizeFFormatInts ();
\r
3808 public class GraphicsFixturePropTextRenderingHint1 : GraphicsFixture {
\r
3809 public override void SetUp() {
\r
3810 base.SetUp ("GraphicsFixturePropTextRenderingHint1");
\r
3811 t.Graphics.TextRenderingHint = TextRenderingHint.AntiAliasGridFit;
\r
3815 [Category("NotWorking")]
\r
3816 public override void DrawIconTest() {
\r
3817 base.DrawIconTest ();
\r
3821 [Category("NotWorking")]
\r
3822 public override void DrawIconUnstretchedTest() {
\r
3823 base.DrawIconUnstretchedTest ();
\r
3827 [Category("NotWorking")]
\r
3828 public override void DrawImageUnscaledTest() {
\r
3829 base.DrawImageUnscaledTest ();
\r
3833 [Category("NotWorking")]
\r
3834 public override void DrawStringFloatFormat() {
\r
3835 base.DrawStringFloatFormat ();
\r
3839 [Category("NotWorking")]
\r
3840 public override void MeasureCharacterRangesRegions() {
\r
3841 base.MeasureCharacterRangesRegions ();
\r
3845 [Category("NotWorking")]
\r
3846 public override void MeasureStringSizeFFormatInts() {
\r
3847 base.MeasureStringSizeFFormatInts ();
\r
3852 public class GraphicsFixturePropTextRenderingHint2 : GraphicsFixture {
\r
3853 public override void SetUp() {
\r
3854 base.SetUp ("GraphicsFixturePropTextRenderingHint2");
\r
3855 t.Graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
\r
3859 [Category("NotWorking")]
\r
3860 public override void DrawIconTest() {
\r
3861 base.DrawIconTest ();
\r
3865 [Category("NotWorking")]
\r
3866 public override void DrawIconUnstretchedTest() {
\r
3867 base.DrawIconUnstretchedTest ();
\r
3871 [Category("NotWorking")]
\r
3872 public override void DrawImageUnscaledTest() {
\r
3873 base.DrawImageUnscaledTest ();
\r
3877 [Category("NotWorking")]
\r
3878 public override void DrawStringFloatFormat() {
\r
3879 base.DrawStringFloatFormat ();
\r
3883 [Category("NotWorking")]
\r
3884 public override void MeasureCharacterRangesRegions() {
\r
3885 base.MeasureCharacterRangesRegions ();
\r
3889 [Category("NotWorking")]
\r
3890 public override void MeasureStringSizeFFormatInts() {
\r
3891 base.MeasureStringSizeFFormatInts ();
\r
3896 public class GraphicsFixturePropTextRenderingHint3 : GraphicsFixture {
\r
3897 public override void SetUp() {
\r
3898 base.SetUp ("GraphicsFixturePropTextRenderingHint3");
\r
3899 t.Graphics.TextRenderingHint = TextRenderingHint.SingleBitPerPixel;
\r
3903 [Category("NotWorking")]
\r
3904 public override void DrawIconTest() {
\r
3905 base.DrawIconTest ();
\r
3909 [Category("NotWorking")]
\r
3910 public override void DrawIconUnstretchedTest() {
\r
3911 base.DrawIconUnstretchedTest ();
\r
3915 [Category("NotWorking")]
\r
3916 public override void DrawImageUnscaledTest() {
\r
3917 base.DrawImageUnscaledTest ();
\r
3921 [Category("NotWorking")]
\r
3922 public override void DrawStringFloatFormat() {
\r
3923 base.DrawStringFloatFormat ();
\r
3927 [Category("NotWorking")]
\r
3928 public override void MeasureCharacterRangesRegions() {
\r
3929 base.MeasureCharacterRangesRegions ();
\r
3933 [Category("NotWorking")]
\r
3934 public override void MeasureStringSizeFFormatInts() {
\r
3935 base.MeasureStringSizeFFormatInts ();
\r
3940 public class GraphicsFixturePropTextRenderingHint4 : GraphicsFixture {
\r
3941 public override void SetUp() {
\r
3942 base.SetUp ("GraphicsFixturePropTextRenderingHint4");
\r
3943 t.Graphics.TextRenderingHint = TextRenderingHint.SingleBitPerPixelGridFit;
\r
3947 [Category("NotWorking")]
\r
3948 public override void DrawIconTest() {
\r
3949 base.DrawIconTest ();
\r
3953 [Category("NotWorking")]
\r
3954 public override void DrawIconUnstretchedTest() {
\r
3955 base.DrawIconUnstretchedTest ();
\r
3959 [Category("NotWorking")]
\r
3960 public override void DrawImageUnscaledTest() {
\r
3961 base.DrawImageUnscaledTest ();
\r
3965 [Category("NotWorking")]
\r
3966 public override void DrawStringFloatFormat() {
\r
3967 base.DrawStringFloatFormat ();
\r
3971 [Category("NotWorking")]
\r
3972 public override void MeasureCharacterRangesRegions() {
\r
3973 base.MeasureCharacterRangesRegions ();
\r
3977 [Category("NotWorking")]
\r
3978 public override void MeasureStringSizeFFormatInts() {
\r
3979 base.MeasureStringSizeFFormatInts ();
\r
3984 public class GraphicsFixturePropTextRenderingHint5 : GraphicsFixture {
\r
3985 public override void SetUp() {
\r
3986 base.SetUp ("GraphicsFixturePropTextRenderingHint5");
\r
3987 t.Graphics.TextRenderingHint = TextRenderingHint.SystemDefault;
\r
3991 [Category("NotWorking")]
\r
3992 public override void DrawIconTest() {
\r
3993 base.DrawIconTest ();
\r
3997 [Category("NotWorking")]
\r
3998 public override void DrawIconUnstretchedTest() {
\r
3999 base.DrawIconUnstretchedTest ();
\r
4003 [Category("NotWorking")]
\r
4004 public override void DrawImageUnscaledTest() {
\r
4005 base.DrawImageUnscaledTest ();
\r
4009 [Category("NotWorking")]
\r
4010 public override void DrawStringFloatFormat() {
\r
4011 base.DrawStringFloatFormat ();
\r
4015 [Category("NotWorking")]
\r
4016 public override void MeasureCharacterRangesRegions() {
\r
4017 base.MeasureCharacterRangesRegions ();
\r
4021 [Category("NotWorking")]
\r
4022 public override void MeasureStringSizeFFormatInts() {
\r
4023 base.MeasureStringSizeFFormatInts ();
\r
4029 #region GraphicsFixturePropTransform
\r
4032 public class GraphicsFixturePropTransform : GraphicsFixture {
\r
4033 public override void SetUp() {
\r
4034 base.SetUp ("GraphicsFixturePropTransform");
\r
4035 t.Graphics.Transform = new Matrix(0, 1, 2, 0, 0, 0);
\r
4037 st["DrawArcTest:2"] = TOLERANCE * 11.0f; // FIXME: Transfrom is ok, but very big difference in width
\r
4038 st["DrawArcTest:4"] = TOLERANCE * 12.0f; // FIXME: Transfrom is ok, but very big difference in width
\r
4039 st["DrawArcTest:6"] = TOLERANCE * 12.0f; // FIXME: Transfrom is ok, but very big difference in width
\r
4040 st["DrawArcTest:8"] = TOLERANCE * 10.0f; // FIXME: Transfrom is ok, but very big difference in width
\r
4041 st["DrawClosedCurveTest:4"] = TOLERANCE * 2.0f;
\r
4042 st["RotateTransformAngleMatrixOrder:2"] = TOLERANCE * 1.5f;
\r
4043 st["TransformPointsPointF:2"] = TOLERANCE * 3.5f;
\r
4047 [Category("NotWorking")]
\r
4048 public override void DrawIconTest() {
\r
4049 base.DrawIconTest ();
\r
4053 [Category("NotWorking")]
\r
4054 public override void DrawIconUnstretchedTest() {
\r
4055 base.DrawIconUnstretchedTest ();
\r
4059 [Category("NotWorking")]
\r
4060 public override void DrawImageUnscaledTest() {
\r
4061 base.DrawImageUnscaledTest ();
\r
4065 [Category("NotWorking")]
\r
4066 public override void DrawStringFloatFormat() {
\r
4067 base.DrawStringFloatFormat ();
\r
4071 [Category("NotWorking")]
\r
4072 public override void MeasureCharacterRangesRegions() {
\r
4073 base.MeasureCharacterRangesRegions ();
\r
4077 [Category("NotWorking")]
\r
4078 public override void MeasureStringSizeFFormatInts() {
\r
4079 base.MeasureStringSizeFFormatInts ();
\r