Example #1
0
        private void _updateDimensions(double width, double height)
        {
            _appWidth  = (float)width + 5;
            _appHeight = (float)height;

            if (_deviceManager == null)
            {
                return;
            }
            if (_stagingTexture2D != null)
            {
                _stagingTexture2D.Dispose();
            }
            if (_stagingBitmap != null)
            {
                _stagingBitmap.Dispose();
            }
            if (_stagingBitmapSourceEffect != null)
            {
                _stagingBitmapSourceEffect.Dispose();
            }

            _stagingTexture2D          = AllocateTextureReturnSurface((int)_appWidth, (int)_appHeight);
            _stagingBitmap             = new SharpDX.Direct2D1.Bitmap1(_deviceManager.ContextDirect2D, _stagingTexture2D.QueryInterface <SharpDX.DXGI.Surface>());
            _stagingBitmapSourceEffect = new SharpDX.Direct2D1.Effects.BitmapSource(_deviceManager.ContextDirect2D);
        }