Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to save the bitmap context to bitmap file.



On Oct 23, 2007, at 6:50 PM, Yu, Min wrote:

Now I try to transform image (jpeg, tiff, gif) to bitmap file. first I create bitmap CGContextRef and call CGContextDrawIamge to draw image (jpeg, tiff, gif) into bitmap context and get bitmap context data, when I save bitmap context data to file, but the file can not be opened.

Do you have some suggestion or other way to transform image to bitmap file?

If you want to change the format of an image via Image IO, then you should look at CGImageDestinationAddImageFromSource() to create the new image. This will let you convert any image that Image IO can open to any one that it can save. Similarly if you just have a bitmapped image you want to save to disk you can use CGImageDestinationAddImage(). These both require a CGImageDestinationRef that you can create with any of the CGImageDestinationCreate*() functions.
--
Reality is what, when you stop believing in it, doesn't go away.
Failure is not an option. It is a privilege reserved for those who try.


David Duncan

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden
References: 
 >How to save the bitmap context to bitmap file. (From: "Yu, Min" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.