示例#1
0
 void ClearImageSource()
 {
     if (_sisNative != null)
     {
         image.Source = null;
         _sisNative.Dispose();
         _sisNative   = null;
         _imageSource = null;
     }
 }
示例#2
0
        void MainPage_Unloaded(object sender, RoutedEventArgs e)
        {
            DiscardDeviceResources();

            _bitmap.Dispose();
            _d2dFactory.Dispose();
            _dwFactory.Dispose();

            image.Source = null;
            _sisNative.Dispose();
            _sisNative = null;
        }
示例#3
0
        void CreateImageSource()
        {
            ClearImageSource();

            _imageSource = new SurfaceImageSource(_bitmap.PixelWidth, _bitmap.PixelHeight, false);

            _sisNative = ComObject.QueryInterface <DXGI.ISurfaceImageSourceNative>(_imageSource);
            _sisNative.SetDevice(_dxgiDevice);

            UpdateImageSource(false);

            image.Source = _imageSource;
        }