Example #1
0
        private void btnDrawWithMask_Click(object sender, EventArgs e)
        {
            //clear background
            drawer.Clear(Colors.White);

            //render hint for mask region
            DrawMaskRegion();

            //create an opacity mask
            MaskBuffer mask = new MaskBuffer(buffer.Width, buffer.Height);
            double[] coordinates = TestFactory.Star();
            TestFactory.Scale(coordinates, 8.0);
            Fill fill = Fills.Black;
            MaskDrawer maskDrawer = new MaskDrawer(mask);
            maskDrawer.DrawPolygon(fill, coordinates);

            //render the lion using the opacity mask

            drawer.Mask = mask;
            DrawLion();

            //show to screen
            DisplayBuffer(buffer);

            //reset opacity mask so that other tests aren't afffected
            drawer.Mask = null;
        }
Example #2
0
 /// <summary>
 /// Create a new instance for the provided buffer
 /// </summary>
 public MaskDrawer(MaskBuffer buffer)
 {
     mBuffer = buffer;
 }