2 using System.Drawing;
\r
3 using System.Diagnostics;
\r
4 using System.Windows.Forms;
\r
5 using D2DBench.Properties;
\r
9 class Method8 : IBench
\r
11 public int fillAreaSize { get { return bmpSize.Width * bmpSize.Height * Form1.ExecuteCountPerOneset; } }
\r
12 public string methodName { get { return "GDIBitBlt"; } }
\r
15 ColorTableGDI colors;
\r
17 const string showStr = "D2DBenchMark";
\r
22 public void Init(Control ctrl, bool antialias)
\r
24 ClientSize = ctrl.ClientSize;
\r
25 gdi = new GDI(ctrl);
\r
26 colors = new ColorTableGDI();
\r
28 bmpSize = Resources.image.Size;
\r
29 bmp = gdi.LoadImage(Resources.image);
\r
35 Random rnd = new Random();
\r
37 for (int j = 0; j < Form1.ExecuteCountPerOneset; j++)
\r
39 Rectangle rect = new Rectangle();
\r
40 rect.X = rnd.Next(ClientSize.Width);
\r
41 rect.Y = rnd.Next(ClientSize.Height);
\r
42 rect.Width = rect.X + bmpSize.Width;
\r
43 rect.Height = rect.Y + bmpSize.Height;
\r
44 gdi.DrawImage(rect, bmp);
\r
49 public void Dispose()
\r
51 gdi.UnloadImage(bmp);
\r