Beispiel #1
0
        public void RenderStipple()
        {
            IRenderImage dest = RenderImage.Create(16, 16);

            Render.renderColoredStippleTile(dest, 0, 0, GREEN, WHITE);
            Assert.AreEqual(WHITE, dest.GetPixel(0, 0));
            Assert.AreEqual(GREEN, dest.GetPixel(1, 0));
            Assert.AreEqual(WHITE, dest.GetPixel(2, 0));
            Assert.AreEqual(GREEN, dest.GetPixel(3, 0));

            Assert.AreEqual(GREEN, dest.GetPixel(0, 1));
            Assert.AreEqual(WHITE, dest.GetPixel(1, 1));
        }
Beispiel #2
0
        public void RenderStippleClipping()
        {
            IRenderImage dest = RenderImage.Create(14, 14);

            dest.Clear(BLACK);

            Render.renderColoredStippleTile(dest, 4, 4, GREEN, WHITE);
            Assert.AreEqual(BLACK, dest.GetPixel(0, 0));
            Assert.AreEqual(BLACK, dest.GetPixel(1, 1));
            Assert.AreEqual(BLACK, dest.GetPixel(2, 2));
            Assert.AreEqual(BLACK, dest.GetPixel(3, 3));

            Assert.AreEqual(WHITE, dest.GetPixel(4, 4));
            Assert.AreEqual(GREEN, dest.GetPixel(5, 4));
            Assert.AreEqual(WHITE, dest.GetPixel(6, 4));
            Assert.AreEqual(GREEN, dest.GetPixel(7, 4));

            Assert.AreEqual(GREEN, dest.GetPixel(4, 5));
            Assert.AreEqual(WHITE, dest.GetPixel(5, 5));
            Assert.AreEqual(GREEN, dest.GetPixel(6, 5));
            Assert.AreEqual(WHITE, dest.GetPixel(7, 5));
        }