Juan Munhoes Junior
Juan Munhoes Junior

Reputation: 895

load UIImage low quality

I would like to know how to load first a low quality UIImage and then load the original UIImage in high quality. Does it have an algorithm to do this in objective-c? I checked it out the class NYXImagesKit but it only works with iOS 5+ because it uses Core Image framework...And i need to work this with iOS 4.3+. Its effect is like Facebook app does.

JUST A edit:

check this out : http://www.codinghorror.com/blog/2005/12/progressive-image-rendering.html

i want to do the Effect number 2

Upvotes: 1

Views: 746

Answers (2)

Peter Sarnowski
Peter Sarnowski

Reputation: 11970

From the docs:

Incrementally Loading an Image

If you have a very large image, or are loading image data over the web, you may want to create an incremental image source so that you can draw the image data as you accumulate it. You need to perform the following tasks to load an image incrementally from a CFData object:

  1. Create the CFData object for accumulating the image data.
  2. Create an incremental image source by calling the function CGImageSourceCreateIncremental.
  3. Add image data to the CFData object.
  4. Call the function CGImageSourceUpdateData, passing the CFData object and a Boolean value (bool data type) that specifies whether the data parameter contains the entire image, or just partial image data. In any case, the data parameter must contain all the image file data accumulated up to that point.
  5. If you have accumulated enough image data, create an image by calling CGImageSourceCreateImageAtIndex, draw the partial image, and then release it.
  6. Check to see if you have all the data for an image by calling the function CGImageSourceGetStatusAtIndex. If the image is complete, this function returns kCGImageStatusComplete. If the image is not complete, repeat steps 3 and 4 until it is.
  7. Release the incremental image source.

Upvotes: 2

thavasidurai
thavasidurai

Reputation: 2002

You can refer below link, it may be help you

uiimage-dsp

Upvotes: 0

Related Questions