Compared to the large number of features in CompositionProToolkit v0.4, version 0.4.1 incorporates the CompositionImageFrame control and code optimizations.
If you want to know more about the new features added to CompositionProToolkit v0.4 check my previous post.
CompositionImageFrame is a control which can be used for displaying images. It encapsulates a CompositionSurfaceImage object which is used for loading and rendering the images. It also supports Pointer interactions and raises events accordingly.
In order to configure the rendering of the image, CompositionImageFrame has the following properties
|Dependency Property||Type||Description||Default Value|
||Specifies how the image is positioned horizontally in the CompositionImageFrame.||AlignmentX.Center|
||Specifies how the image is positioned vertically in the CompositionImageFrame.||AlignmentY.Center|
||Specifies the background color of the CompositionImageFrame to fill the area where image is not rendered.||Colors.Black|
||Specifies the interpolation used for rendering the image.||HighQualityCubic|
||Specifies the Uri of the image to be loaded into the CompositionImageFrame.||null|
||Specifies how the image is resized to fill its allocated space in the CompositionImageFrame.||Uniform|
CompositionImageFrame raises the following events
- ImageOpened – when the image has been successfully loaded from the Uri and rendered.
- ImageFailed – when there is an error loading the image from the Uri.
If you want to see the various controls and features of CompositionProToolkit in action, check out the SampleGallery project in GitHub.