--- title: "How to: Chain BitmapSource Objects Together" ms.date: "03/30/2017" dev_langs: - "csharp" - "vb" helpviewer_keywords: - "BitmapSource objects [WPF], chaining" - "graphics [WPF], chaining BitmapSource objects" - "chaining BitmapSource objects [WPF]" ms.assetid: 32d88853-395b-4855-9685-51a482a3b421 --- # How to: Chain BitmapSource Objects Together This example shows how you can apply a variety of effects to an image source by chaining multiple derived objects together. The following example uses chaining to flip and change the pixel format of the source of an image. ## Example [!code-xaml[ImagingSnippetGallery_snip#ChainedBitmapSourcesXamlExampleWholePage](~/samples/snippets/csharp/VS_Snippets_Wpf/ImagingSnippetGallery_snip/CS/ChainedBitmapSourcesExample.xaml#chainedbitmapsourcesxamlexamplewholepage)] [!code-csharp[ImagingSnippetGallery_procedural_snip#ChainedBitmapSourcesCodeExampleWholePage](~/samples/snippets/csharp/VS_Snippets_Wpf/ImagingSnippetGallery_procedural_snip/CSharp/ChainedBitmapSourcesExample.cs#chainedbitmapsourcescodeexamplewholepage)] [!code-vb[ImagingSnippetGallery_procedural_snip#ChainedBitmapSourcesCodeExampleWholePage](~/samples/snippets/visualbasic/VS_Snippets_Wpf/ImagingSnippetGallery_procedural_snip/VB/ChainedBitmapSourcesExample.vb#chainedbitmapsourcescodeexamplewholepage)]