Example #1
0
        private void PaintControlDoubleBuffered(FluidPaintEventArgs pe, FluidControl control, Rectangle bounds)
        {
            Bitmap buffer;

            if (imageBuffer.Contains(control))
            {
                buffer = imageBuffer[control] as Bitmap;
            }
            else
            {
                buffer = new Bitmap(bounds.Width, bounds.Height);
                imageBuffer.Add(control, buffer);
                using (Graphics bg = Graphics.FromImage(buffer))
                {
                    this.transparentBrush.Color = transparentColor;
                    bg.FillRectangle(transparentBrush, 0, 0, buffer.Width, buffer.Height);
                    Rectangle paintRect = control.ClientRectangle;
                    //bg.Clear(transparentColor);

                    FluidPaintEventArgs e = paintEventArgs;
                    e.Graphics      = bg;
                    e.ControlBounds = paintRect;
                    e.Region        = bg.Clip;
                    e.ScaleFactor   = pe.ScaleFactor;
                    control.OnPaint(e);
                }
            }
            ia.SetColorKey(transparentColor, transparentColor);
            pe.Graphics.DrawImage(buffer, bounds, 0, 0, bounds.Width, bounds.Height, GraphicsUnit.Pixel, ia);
        }
Example #2
0
        protected void PaintControlUnbuffered(FluidPaintEventArgs pe, FluidControl control, Rectangle bounds)
        {
            FluidPaintEventArgs e = paintEventArgs;

            e.Graphics      = pe.Graphics;
            e.ControlBounds = bounds;
            e.Region        = pe.Region;
            e.ScaleFactor   = pe.ScaleFactor;
            control.OnPaint(e);
        }
Example #3
0
        private void PaintControlUnbuffered(FluidPaintEventArgs pe, FluidControl control, Rectangle bounds)
        {
            //bounds.Offset(Left, Top);
            //Region clp = pe.IntersectClip(bounds);
            FluidPaintEventArgs e = paintEventArgs2;

            e.Graphics      = pe.Graphics;
            e.ControlBounds = bounds;
            e.Region        = pe.Region;
            e.ScaleFactor   = pe.ScaleFactor;
            control.OnPaint(e);
            //pe.ResetClip(clp);
        }
Example #4
0
        protected override void OnPaint(PaintEventArgs pe)
        {
            if (control != null)
            {
                Graphics g = pe.Graphics;

                // this is necassary, when the invalidate() was made outside the fluid control (e.g. when a control overlaps this control)::
                region.Union(pe.ClipRectangle);
                //                pe.Graphics.Clear(Color.Yellow);
                FluidPaintEventArgs e = paintEvents;
                e.Graphics      = g;
                e.Region        = region;
                g.Clip          = region;
                e.ControlBounds = ClientRectangle;
                e.ScaleFactor   = ScaleFactor;
                control.OnPaint(e);
                region.MakeEmpty();
            }
        }
Example #5
0
 private void PaintControlUnbuffered(FluidPaintEventArgs pe, FluidControl control, Rectangle bounds)
 {
     //bounds.Offset(Left, Top);
     //Region clp = pe.IntersectClip(bounds);
     FluidPaintEventArgs e = paintEventArgs2;
     e.Graphics = pe.Graphics;
     e.ControlBounds = bounds;
     e.Region = pe.Region;
     e.ScaleFactor = pe.ScaleFactor;
     control.OnPaint(e);
     //pe.ResetClip(clp);
 }
Example #6
0
        private void PaintControlDoubleBuffered(FluidPaintEventArgs pe, FluidControl control, Rectangle bounds)
        {
            Bitmap buffer;
            if (imageBuffer.Contains(control))
            {
                buffer = imageBuffer[control] as Bitmap;
            }
            else
            {
                buffer = new Bitmap(bounds.Width, bounds.Height);
                imageBuffer.Add(control, buffer);
                using (Graphics bg = Graphics.FromImage(buffer))
                {
                    this.transparentBrush.Color = transparentColor;
                    bg.FillRectangle(transparentBrush, 0, 0, buffer.Width, buffer.Height);
                    Rectangle paintRect = control.ClientRectangle;
                    //bg.Clear(transparentColor);

                    FluidPaintEventArgs e = paintEventArgs;
                    e.Graphics = bg;
                    e.ControlBounds = paintRect;
                    e.Region = bg.Clip;
                    e.ScaleFactor = pe.ScaleFactor;
                    control.OnPaint(e);
                }

            }
            ia.SetColorKey(transparentColor, transparentColor);
            pe.Graphics.DrawImage(buffer, bounds, 0, 0, bounds.Width, bounds.Height, GraphicsUnit.Pixel, ia);
        }
Example #7
0
 protected void PaintControlUnbuffered(FluidPaintEventArgs pe, FluidControl control, Rectangle bounds)
 {
     FluidPaintEventArgs e = paintEventArgs;
     e.Graphics = pe.Graphics;
     e.ControlBounds = bounds;
     e.Region = pe.Region;
     e.ScaleFactor = pe.ScaleFactor;
     control.OnPaint(e);
 }