コード例 #1
0
        protected void SwapDrawBuffer()
        {
            try
            {
                _lockDc.Wait();

                if (_activeDC == ActiveDrawBuffer.DC0)
                {
                    var tmpScreen   = _offScreen[0];
                    var tmpScreenDC = _offScreenDc[0];
                    _offScreen[0]   = _offScreen[1];
                    _offScreenDc[0] = _offScreenDc[1];
                    _offScreen[1]   = tmpScreen;
                    _offScreenDc[1] = tmpScreenDC;

                    _activeDC = ActiveDrawBuffer.DC1;
                }
                else
                {
                    _activeDC = ActiveDrawBuffer.DC0;
                }
            }
            finally
            {
                _lockDc.Release();
            }
        }
コード例 #2
0
        private void Resize(bool bUpdate)
        {
            try
            {
                _lockDc.Wait();

                if (Width > 0 && Height > 0 && !Terminating)
                {
                    for (var i = 0; i <= 1; i++)
                    {
                        _offScreen[i]   = new Bitmap(Width, Height, PiFormat);
                        _offScreenDc[i] = Graphics.FromImage(_offScreen[i]);

                        _offScreenDc[i].InterpolationMode  = InterpolationMode.Low;
                        _offScreenDc[i].CompositingQuality = CompositingQuality.HighSpeed;
                        _offScreenDc[i].SmoothingMode      = SmoothingMode.HighSpeed;
                    }
                    _activeDC = ActiveDrawBuffer.DC0;

                    TranslateCoords();

                    if (bUpdate)
                    {
                        Update(new Rectangle(0, 0, Width, Height));
                    }
                }
                else
                {
                    _offScreen[0]   = null;
                    _offScreenDc[0] = null;
                    _offScreen[1]   = null;
                    _offScreenDc[1] = null;
                }
            }
            finally
            {
                _lockDc.Release();
            }
        }
コード例 #3
0
        protected void SwapDrawBuffer()
        {
            try
            {
                _lockDc.Wait();
                
                if (_activeDC == ActiveDrawBuffer.DC0)
                {
                    var tmpScreen = _offScreen[0];
                    var tmpScreenDC = _offScreenDc[0];
                    _offScreen[0] = _offScreen[1];
                    _offScreenDc[0] = _offScreenDc[1];
                    _offScreen[1] = tmpScreen;
                    _offScreenDc[1] = tmpScreenDC;

                    _activeDC = ActiveDrawBuffer.DC1;
                }
                else
                {
                    _activeDC = ActiveDrawBuffer.DC0;
                }
            }
            finally
            {
                _lockDc.Release();
            }
        }
コード例 #4
0
        private void Resize(bool bUpdate)
        {
            try
            {
                _lockDc.Wait();
                
                if (Width > 0 && Height > 0 && !Terminating)
                {
                    for (var i = 0; i <= 1; i++)
                    {
                        _offScreen[i] = new Bitmap(Width, Height, PiFormat);
                        _offScreenDc[i] = Graphics.FromImage(_offScreen[i]);

                        _offScreenDc[i].InterpolationMode = InterpolationMode.Low;
                        _offScreenDc[i].CompositingQuality = CompositingQuality.HighSpeed;
                        _offScreenDc[i].SmoothingMode = SmoothingMode.HighSpeed;
                    }
                    _activeDC = ActiveDrawBuffer.DC0;
                    
                    TranslateCoords();

                    if (bUpdate)
                        Update(new Rectangle(0, 0, Width, Height));
                }
                else
                {
                    _offScreen[0] = null;
                    _offScreenDc[0] = null;
                    _offScreen[1] = null;
                    _offScreenDc[1] = null;
                }
            }
            finally
            {
                _lockDc.Release();
            }
        }