Saturday, 15 May 2010

java - Android save gif from byte array -



java - Android save gif from byte array -

when using below code save byte array gif, gif file blurred.

but if save byte array png or jpg ok. know problem is?

public writetofile(byte[] array) { seek { string path = "..."; fileoutputstream stream = new fileoutputstream(path); stream.write(array); } grab (filenotfoundexception e) { e.printstacktrace(); } }

gif limited 256 colors , not back upwards real transparency.

you should utilize png instead of gif because offers improve compression , features. png great little , simple images logos, icons, etc.

jpeg has improve compression complex images photos.

png has wider color pallete gif , gif properitary while png not. gif can animations, normal-png cannot. png-transparency supported browser more recent ie6, there javascript prepare problem. both back upwards alpha transparency. in general should utilize png webgraphics while using jpeg photos, screenshots, or similiar because png compression not work on thoose.

java android gif

No comments:

Post a Comment