Honken
January 26, 2013, 5:50pm
1
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.
Honken
January 26, 2013, 5:55pm
3
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.
Honken
January 26, 2013, 6:04pm
5
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?
Honken
January 26, 2013, 6:10pm
7
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.
Honken
January 26, 2013, 6:19pm
8
Perfect, I will go for that solution!
Honken
January 26, 2013, 6:26pm
9
Yes, both static html, images and config files in xml.