Files
Andy De George da363692ff Initial WPF content migrated (#17)
* Reset branch for WPF changes

* Convert BMP to PNG; fix link-out-of-scope err

* Add snippets for WPF... 6794 files!!!!

* Add missing snippets

* update file updated between migration

* Fix paths to include

* update breadcrumb and toc

* fix index links

* fix index links

* fix index links

* fix markdown
2020-09-04 09:46:28 -07:00

1.3 KiB

title, ms.date, dev_langs, helpviewer_keywords, ms.assetid
title ms.date dev_langs helpviewer_keywords ms.assetid
How to: Create a Bitmap from a Visual 03/30/2017
csharp
vb
bitmaps [WPF], rendering from visuals
visuals [WPF], rendering to bitmaps
103fc7f5-7306-4026-9d61-2005e79959f3

How to: Create a Bitmap from a Visual

This example shows how you can create a bitmap from a xref:System.Windows.Media.Visual. A xref:System.Windows.Media.DrawingVisual is rendered with xref:System.Windows.Media.FormattedText. The xref:System.Windows.Media.Visual is then rendered to the xref:System.Windows.Media.Imaging.RenderTargetBitmap creating a bitmap of the given text.

Example

[!code-csharpImagingSnippetGallery_procedural_snip#CreateRTBImage] [!code-vbImagingSnippetGallery_procedural_snip#CreateRTBImage]

See also