PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Create XImage from existing resource image (WPF)
https://forum.pdfsharp.net/viewtopic.php?f=2&t=2162
Page 1 of 1

Author:  GreenByte [ Fri Oct 05, 2012 6:28 pm ]
Post subject:  Create XImage from existing resource image (WPF)

Hi,

in WPF applications you can create an XImage object from a resource image using the BitmapImage class:
Code:
var bi = new BitmapImage(new Uri("pack://application:,,,/resources/images/picture.png"));
var image = XImage.FromBitmapSource(bi);

Information about the Pack URI you'll find here: http://msdn.microsoft.com/en-us/library ... 70069.aspx

Kind Regards,
GreenByte

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/