コード例 #1
0
ファイル: DXControl.xaml.cs プロジェクト: ukitake/Stratum
        private void InitializeGraphicsDevice()
        {
            if (_graphicsDeviceService == null)
            {
                _graphicsDeviceService = new DXGraphicsDeviceService();

                // create the image source
                _imageSource = new DXImageSource(
                    GraphicsDevice, (int)ActualWidth, (int)ActualHeight);
                rootImage.Source = _imageSource.WriteableBitmap;

                Services.AddService(typeof(IGraphicsDeviceService), _graphicsDeviceService);
            }
        }
コード例 #2
0
ファイル: DXControl.xaml.cs プロジェクト: ukitake/Stratum
        private void DoResize()
        {
            if (_imageSource != null)
            {
                _imageSource.Dispose();
                _imageSource = new DXImageSource(
                    GraphicsDevice, (int)ActualWidth, (int)ActualHeight);
                _imageSourcePresenter = new RenderTargetGraphicsPresenter(GraphicsDevice, _imageSource.RenderTarget);

                rootImage.Source = _imageSource.WriteableBitmap;
                if (Resized != null)
                {
                    Resized(this, EventArgs.Empty);
                }
            }
        }
コード例 #3
0
ファイル: DXControl.xaml.cs プロジェクト: ukitake/Stratum
        private void InitializeGraphicsDevice()
        {
            if (_graphicsDeviceService == null)
            {
                _graphicsDeviceService = new DXGraphicsDeviceService();

                // create the image source
                _imageSource = new DXImageSource(
                    GraphicsDevice, (int)ActualWidth, (int)ActualHeight);
                rootImage.Source = _imageSource.WriteableBitmap;

                Services.AddService(typeof(IGraphicsDeviceService), _graphicsDeviceService);
            }
        }
コード例 #4
0
ファイル: DXControl.xaml.cs プロジェクト: ukitake/Stratum
        private void DoResize()
        {
            if (_imageSource != null)
            {
                _imageSource.Dispose();
                _imageSource = new DXImageSource(
                    GraphicsDevice, (int)ActualWidth, (int)ActualHeight);
                _imageSourcePresenter = new RenderTargetGraphicsPresenter(GraphicsDevice, _imageSource.RenderTarget);

                rootImage.Source = _imageSource.WriteableBitmap;
                if (Resized != null)
                {
                    Resized(this, EventArgs.Empty);
                }
            }
        }