Resources.GetBitmap().GetBitmap() gives wrong size in 4.2

When having a .gif image in the resource and getting it to an byte array, the array length will have a faulty number.

My gif was 4120 bytes on disk, but 70840 in array.

If i renamed the image to .bin and read it from Resources like a byte[] I got the correct length, 4120.

Bitmap and Gif are different image formats. Bitmap is uncompressed.

Correct, but wouldn’t the under layers handle this as the “resource manager” sens that it’s a gif file I am adding?

But there should be a common denominator that all various image formats are translated to earlier in the pipeline.

Okey, so are there any safe way of getting a byte array or stream from a resource gif with correct length?

What about including it as .bin?

Thats how I do it now, but it makes testing of my webserver pages hard as all the link is getting corrupt when the source doesn’t have the correct file extenstion.

Perfect, I will go for that solution!

Yes, both static html, images and config files in xml.