[Resolved][C#] Bitmap to something I can display?
Hey guys, I've got a resource file which I'm storing Bitmaps in (they're Image data type in .Net, but in the resource file they're System.Drawing.Bitmap).
I've read it out and converted it to a Bitmap, but now I need to get it to a format that I can display in WPF Image Control (takes an ImageSource I do believe). Any suggestions? :\ Google has epically failed me. :(
I dunno if theres a way to change how images get stored into a Resource file, maybe that could help solve the problem. :)
Re: [C#] Bitmap to something I can display?
Can't you just set the source as the path to the image in the RESX file?
Code:
<Image Source="/Assemblyname;resourcefilename/abc.jpg" />
Else you'll have to set the Image1.Source property in code by converting the Bitmap to a BitmapSource. You could look at the BitmapSource.Create method, though there may be other ways.
Re: [C#] Bitmap to something I can display?
Quote:
Originally Posted by mendhak
Can't you just set the source as the path to the image in the RESX file?
Code:
<Image Source="/Assemblyname;resourcefilename/abc.jpg" />
Else you'll have to set the Image1.Source property in code by converting the Bitmap to a BitmapSource. You could look at the BitmapSource.Create method, though there may be other ways.
Neg, the resource files are external, I'm using them as thumbs.db alternatives. :p
But your suggestion helped me find the code I need. :D PngBitmapDecoder. :) I thought I tried that earlier, but apparently not. :)
http://social.msdn.microsoft.com/For...-0cc2b0f80cf0/