tags:

views:

568

answers:

3

Can I save (write to file) UIImage object as bitmap file (.bmp extension) in iPhone’s document directory?

Thanks in advance.

A: 

Since BMP is not a compressed format, is this a good idea?

Presumably, image size is even more important on portable devices.

pavium
A: 

Right now I am not concerned about the size. Just want to know can I write image data as .bmp file.

Prajakta
Fair enough, I hope someone with an iphone can let you know. Maybe Apple DOES support older Windows image formats - I don't know. Good Luck.
pavium
Come on guys – if you just want to comment on an answer, there is a ‘add comment’ link under each answer. Using the site properly is not that hard and makes it better for all of us.
zoul
ok. Next time i will take care of this.
Prajakta
+2  A: 

I don’t think BMP is supported on iPhone. Maybe somebody wrote a category for UIImage that does saving into BMP, but I don’t know about any. I guess You’ll have to get the bitmap data from the UIImage and write them yourself, BMP is quite a simple file format. All you have to do is write out the header and then the uncompressed data. The header is a structure called BITMAPINFOHEADER, see MSDN. Getting the bitmap data of an UIImage is described in Apple’s Technical Q&A1509.

zoul