Files
Andy (Steve) De George be103da07e Replace various WPF include files with content (#1335)
* net-current-v30plus-md.md

* net-current-v40plus-md.md

* tla2sharptla-ui-md.md

* tla2sharptla-uiautomation-md.md

* tla2sharptla-winclient-md.md

* tla2sharptla-xaml-md.md

* tlasharptla-ui-md.md

* tlasharptla-uiautomation-md.md

* tlasharptla-winclient-md.md

* tlasharptla-xaml-md.md

* fix warnings
2022-03-16 12:14:11 -04:00

1.8 KiB

title, description, ms.date, ms.custom, dev_langs, helpviewer_keywords, ms.assetid
title description ms.date ms.custom dev_langs helpviewer_keywords ms.assetid
How to: Load an Image as a Thumbnail Learn how to Load an Image as a Thumbnail. 03/30/2017 devdivchpfy22
csharp
vb
loading images as thumbnails [WPF]
images [WPF], loading as thumbnails
thumbnails [WPF], loading images as
02e055a0-54df-499a-b8b6-ab6ff7535cff

How to: Load an Image as a Thumbnail

The following examples show how to load an xref:System.Windows.Controls.Image as a thumbnail to conserve application memory.

Set the DecodePixelWidth property in XAML

The following example sets the xref:System.Windows.Media.Imaging.BitmapImage.DecodePixelWidth%2A property of a xref:System.Windows.Media.Imaging.BitmapImage in Extensible Application Markup Language (XAML) to reduce the memory required to load the image.

[!code-xamlImageElementExample_snip#ImageSimpleExampleInlineMarkup]

Set the DecodePixelWidth property in code

The following example sets the xref:System.Windows.Media.Imaging.BitmapImage.DecodePixelWidth%2A property of a xref:System.Windows.Media.Imaging.BitmapImage in code to reduce the memory required to load the image.

[!code-csharpImageElementExample_snip#ImageSimpleExampleInlineCode1] [!code-vbImageElementExample_snip#ImageSimpleExampleInlineCode1]

See also