tags:

views:

362

answers:

1

I need to store the bitmap image information in Xaml formated file.

Can any one pls help me out on this regard?

Thanks in advance.

Ravi Naik

+2  A: 

It can't be done (Charles Petzold)

Sure, you can refer to external bitmaps in XAML files, but you can't embed a bitmap in a XAML file. What you would need is a class that derives from BitmapSource that has a property named Data or something that you could set to an array of bytes, and a converter that would accept a list of quoted bytes in the XAML file. And such a class does not exist.

What you really shouldn't be doing is getting weird and dangerous ideas, like possibly simulating a bitmap using a UniformGrid containing a bunch of one-pixel square Rectangle objects, one for each pixel. That's just nuts.

Once you start thinking crazy thoughts like that, you're likely to take a 6K 220×260 color JPEG and convert it into a 1.9 megabyte EmbeddedBitmap.xaml file that takes way too much time to load and compose.

Surely you have better sense than that!

Shay Erlichmen
hello Shay Erlichmen, what I need is, I want to store image information into xaml format. and I want to know how do i do the same using c# code. pls help me out on this regard.
Ravi Naik