C# Class Microsoft.DwayneNeed.Media.Imaging.ChainedBitmap

The ChainedBitmap class is the base class for custom bitmaps that processes the content of another source.
The default implementation of the BitmapSource virtuals is to delegate to the source. This makes sense for most properties like DpiX, DpiY, PixelWidth, PixelHeight, etc, as in many scenarios these properties are the same for the entire chain of bitmap sources. However, derived classes should pay special attention to the Format property. Many bitmap processors only support a limited number of pixel formats, and they should return this for the Format property. ChainedBitmap will take care of converting the pixel format as needed in the base implementation of CopyPixels.
Inheritance: CustomBitmap
Mostra file Open project: cplotts/WPFSLBlendModeFx Class Usage Examples

Public Properties

Property Type Description
SourceProperty System.Windows.DependencyProperty

Protected Methods

Method Description
CopyCore ( CustomBitmap original, bool useCurrentValue, bool willBeFrozen ) : void

Copies data into a cloned instance.

Override this method if you have additional non-DP state that should be transfered to clones.

CopyPixelsCore ( System.Windows.Int32Rect sourceRect, int stride, int bufferSize, IntPtr buffer ) : void

Requests pixels from the ChainedCustomBitmapSource.

This implementation simply delegates to the source, if present.

CreateInstanceCore ( ) : System.Windows.Freezable

Creates an instance of the ChainedBitmap class.

FreezeCore ( bool isChecking ) : bool

Transitions this instance into a thread-safe, read-only mode.

Override this method if you have additional non-DP state that should be frozen along with the instance.

OnSourcePropertyChanged ( System.Windows.DependencyPropertyChangedEventArgs e ) : void

Private Methods

Method Description
OnSourceDecodeFailed ( object sender, ExceptionEventArgs e ) : void
OnSourceDownloadCompleted ( object sender, EventArgs e ) : void
OnSourceDownloadFailed ( object sender, ExceptionEventArgs e ) : void
OnSourceDownloadProgress ( object sender, System.Windows.Media.Imaging.DownloadProgressEventArgs e ) : void
OnSourcePropertyChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void

Method Details

CopyCore() protected method

Copies data into a cloned instance.
Override this method if you have additional non-DP state that should be transfered to clones.
protected CopyCore ( CustomBitmap original, bool useCurrentValue, bool willBeFrozen ) : void
original CustomBitmap /// The original instance to copy data from. ///
useCurrentValue bool /// Whether or not to copy the current value of expressions, or the /// expressions themselves. ///
willBeFrozen bool /// Indicates whether or not the clone will be frozen. If the /// clone will be immediately frozen, there is no need to clone /// data that is already frozen, you can just share the instance. ///
return void

CopyPixelsCore() protected method

Requests pixels from the ChainedCustomBitmapSource.
This implementation simply delegates to the source, if present.
protected CopyPixelsCore ( System.Windows.Int32Rect sourceRect, int stride, int bufferSize, IntPtr buffer ) : void
sourceRect System.Windows.Int32Rect /// The rectangle of pixels being requested. ///
stride int /// The stride of the destination buffer. ///
bufferSize int /// The size of the destination buffer. ///
buffer System.IntPtr /// The destination buffer. ///
return void

CreateInstanceCore() protected method

Creates an instance of the ChainedBitmap class.
protected CreateInstanceCore ( ) : System.Windows.Freezable
return System.Windows.Freezable

FreezeCore() protected method

Transitions this instance into a thread-safe, read-only mode.
Override this method if you have additional non-DP state that should be frozen along with the instance.
protected FreezeCore ( bool isChecking ) : bool
isChecking bool /// Whether or not the transition should really happen, or just to /// determine if the transition is possible. ///
return bool

OnSourcePropertyChanged() protected method

protected OnSourcePropertyChanged ( System.Windows.DependencyPropertyChangedEventArgs e ) : void
e System.Windows.DependencyPropertyChangedEventArgs
return void

Property Details

SourceProperty public_oe static_oe property

The DependencyProperty for the Source property.
public static DependencyProperty,System.Windows SourceProperty
return System.Windows.DependencyProperty