2 using System.Drawing;
\r
3 using System.Diagnostics;
\r
4 using System.Windows.Forms;
\r
8 class Method7 : IBench
\r
10 public int fillAreaSize { get { return bmpSize.Width * bmpSize.Height * this.loopCount; } }
\r
11 public string methodName { get { return "GDI塗りつぶし"; } }
\r
12 public int loopCount { get; set; }
\r
15 ColorTableGDI colors;
\r
17 const string showStr = "D2DBenchMark";
\r
19 Size bmpSize = D2DBench.Properties.Resources.image.Size;
\r
21 public void Init(Control ctrl, bool antialias)
\r
23 ClientSize = ctrl.ClientSize;
\r
24 gdi = new GDI(ctrl);
\r
25 colors = new ColorTableGDI();
\r
32 Random rnd = new Random();
\r
34 for (int j = 0; j < this.loopCount; j++)
\r
36 Color fore = colors[rnd.Next(colors.Count - 1)];
\r
37 Rectangle rect = new Rectangle();
\r
38 rect.X = rnd.Next(ClientSize.Width);
\r
39 rect.Y = rnd.Next(ClientSize.Height);
\r
40 rect.Width = bmpSize.Width;
\r
41 rect.Height = bmpSize.Height;
\r
42 gdi.FillRectangle(rect, fore);
\r
47 public void Dispose()
\r