Exemple #1
0
        public Graphics refGraphics;         //?? hacky?

        public void CreateGraphics()
        {
            Rectangle r;

            if (Control != null)
            {
                r           = Control.ClientRectangle;
                refGraphics = Control.CreateGraphics();
            }
            else
            {
                var tw = Target.Texture2d.Opaque as GDIPTextureWrapper;
                r           = Target.Texture2d.Rectangle;
                refGraphics = Graphics.FromImage(tw.SDBitmap);
            }

            MyBufferedGraphics?.Dispose();
            MyBufferedGraphics = _getBufferedGraphicsContext().Allocate(refGraphics, r);
//			MyBufferedGraphics.Graphics.PixelOffsetMode = PixelOffsetMode.HighSpeed;

            //not sure about this stuff...
            //it will wreck alpha blending, for one thing
//			MyBufferedGraphics.Graphics.CompositingMode = CompositingMode.SourceCopy;
//			MyBufferedGraphics.Graphics.CompositingQuality = CompositingQuality.HighSpeed;
        }