Windows Vista Forums
Vista Forums Home Join Vista Forums Webcasts Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

Init BitmapImage from Project resource

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 08-15-2007   #1 (permalink)
JT
Guest


 

Init BitmapImage from Project resource

Hi all,
How would I initialize a BitmapImage using a bitmap in the project resources
folder?

I know I can use the following to do this, but I wondered if there was some
more abstract method using My.Resources namespace.
Dim bi As New BitmapImage()
' BitmapImage.UriSource must be in a BeginInit/EndInit block.

bi.BeginInit()


bi.UriSource = New Uri("MyFilePath\bitmap1.bmp",
UriKind.RelativeOrAbsolute)
bi.EndInit()


I muddled around a bit with
My.Resources.ResourceManager.GetStream("Bitmap1.bmp"), which returns an
UnmanagedMemoryStream, but can't quite get that to work out.

Any suggestions would be greatly appreciated.

--
John

My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
In any project, Can't we refer classes directly, (without addingphysically in the project)? Rachana .NET General 1 03-28-2008 04:31 PM
Creating an BitmapImage from an ImageBrush? scott.browse@gmail.com Avalon 0 08-13-2007 05:46 PM
How to manage application scope resource file in a library project ? Pon Avalon 4 11-26-2006 04:44 PM
BitmapImage and Bitmap (second shot)) Rhinpoche@star-sw.com Avalon 2 05-18-2006 10:55 AM
Convert BitmapImage to Bitmap? Rhinpoche@star-sw.com Avalon 2 05-18-2006 02:27 AM


Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51