예제 #1
0
        public SurfaceBox()
        {
            this._scaleFactor = ScaleFactor.OneToOne;

            this._rendererList              = new SurfaceBoxRenderList(this.Size, this.Size);
            this._rendererList.Invalidated += Renderers_Invalidated;
            this._baseRenderer              = new SurfaceBoxBaseRenderer(this._rendererList, null);
            this._rendererList.Add(this._baseRenderer, false);

            this.DoubleBuffered = true;
        }
예제 #2
0
        public void RenderTo(Surface dst)
        {
            dst.Clear(ColorBgra.Transparent);

            if (this._surface != null)
            {
                var sbrl = new SurfaceBoxRenderList(this._surface.Size, dst.Size);
                var sbbr = new SurfaceBoxBaseRenderer(sbrl, this._surface);
                sbrl.Add(sbbr, true);
                sbrl.Render(dst, new Point(0, 0));
                sbrl.Remove(sbbr);
            }
        }
예제 #3
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (this._baseRenderer != null)
                {
                    this._rendererList.Remove(this._baseRenderer);
                    this._baseRenderer.Dispose();
                    this._baseRenderer = null;
                }

                if (this._doubleBufferSurface != null)
                {
                    this._doubleBufferSurface.Dispose();
                    this._doubleBufferSurface = null;
                }
            }

            base.Dispose(disposing);
        }