Exemplo n.º 1
0
        public void SetClip(UG.GraphicsPath path, System.Drawing.Drawing2D.CombineMode mode)
        {
            // to mask we make a mask bitmap and draw the shapes to it as an alpha mask.
            RGBA_Bytes shapeMaskColor;
            RGBA_Bytes backgroundMaskColor;

            switch (mode)
            {
            case System.Drawing.Drawing2D.CombineMode.Exclude:
                shapeMaskColor      = new RGBA_Bytes(0, 0, 0, 255);
                backgroundMaskColor = new RGBA_Bytes(255, 255, 255, 255);
                break;

            default:
                throw new NotImplementedException();
            }

            // setup the clip buffer
            var bounds = aggGc.DestImage.GetBounds();

            _clipBuffer = new ImageBuffer(bounds.Width, bounds.Height, 8, new blender_gray(1));
            var clipGC = _clipBuffer.NewGraphics2D();

            clipGC.Clear(backgroundMaskColor);
            clipGC.SetTransform(aggGc.GetTransform());             // apply our transform to the clipper
            clipGC.Render(path.path, shapeMaskColor);

            // ImageClippingProxy clippingProxy = new ImageClippingProxy (_clipBuffer);
            //clippingProxy.clear (backgroundMaskColor);

            // render our shapes to the clipbuf
            // ScanlineCachePacked8 sl = new ScanlineCachePacked8 ();
            // ScanlineRenderer scanlineRenderer = new ScanlineRenderer ();
            // ScanlineRasterizer rasterizer = new ScanlineRasterizer ();

            // rasterizer.add_path (path.path);
            // scanlineRenderer.render_scanlines_aa_solid (clippingProxy, rasterizer, sl, shapeMaskColor);

            // DEBUG_saveImageBuffer(_clipBuffer);
        }
Exemplo n.º 2
0
 public void SetClip(Region region, System.Drawing.Drawing2D.CombineMode combineMode)
 {
     g.SetClip(region, combineMode);
 }
Exemplo n.º 3
0
 public void SetClip(RectangleF rect, System.Drawing.Drawing2D.CombineMode combineMode)
 {
     g.SetClip(rect, combineMode);
 }
Exemplo n.º 4
0
 public void SetClip(System.Drawing.Drawing2D.GraphicsPath path, System.Drawing.Drawing2D.CombineMode combineMode)
 {
     g.SetClip(path, combineMode);
 }
Exemplo n.º 5
0
 public void SetClip(Graphics g, System.Drawing.Drawing2D.CombineMode combineMode)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 6
0
 public void SetClip(System.Drawing.Region region, System.Drawing.Drawing2D.CombineMode combineMode = System.Drawing.Drawing2D.CombineMode.Replace)
 {
     _transformator.Clip = region;
 }
Exemplo n.º 7
0
 public void SetClip(Rectangle rect, System.Drawing.Drawing2D.CombineMode combineMode)
 {
 }
Exemplo n.º 8
0
 public void SetClip(Graphics g, System.Drawing.Drawing2D.CombineMode combineMode)
 {
 }