public void CanClearAndSwap()
        {
            GraphicsWindow wnd = new GraphicsWindow("", 128, 128);

            Graphics.BeginFrame();
            Graphics.Clear(1.0f, 1.0f, 1.0f, 1.0f);
            Graphics.EndFrame();
            Graphics.Swap();

            Bitmap image = wnd.GrabScreen();
            Color color = image.GetPixel(1, 1);
            Assert.AreEqual(Color.FromArgb(0xff, 0xff, 0xff, 0xff), color);
        }
        public void CanResizeWindow()
        {
            using (GraphicsWindow wnd = new GraphicsWindow("Test Window", 128, 128))
            {
                wnd.Camera.BackgroundColor = Color.White;
                wnd.Size = new Size(256, 256);

                GraphicsSystem.DrawFrame(wnd);
                Bitmap image = wnd.GrabScreen();
                Color color = image.GetPixel(250, 250);
                Assert.AreEqual(Color.FromArgb(0xff, 0xff, 0xff, 0xff), color);
            }
        }
        public void CanUseSystemWindow()
        {
            using (TestForm form = new TestForm())
            {
                form.Text = "Test Form";
                form.Width = 256;
                form.Height = 256;
                form.Show();

                using (GraphicsWindow wnd = new GraphicsWindow(form.Handle))
                {
                    wnd.Camera.BackgroundColor = Color.White;
                    GraphicsSystem.DrawFrame();
                    Bitmap image = wnd.GrabScreen();
                    Color color = image.GetPixel(1, 1);
                    Assert.AreEqual(Color.FromArgb(0xff, 0xff, 0xff, 0xff), color);
                }
            }
        }