iPhone - Knowing when an UIImageView has loaded its image -


i'm loading 5mp image uiimageview calling self.imagecontainer.image = myuiimage. myuiimage image coming camera of iphone.

this takes time before image can seen on screen, , if can reduce time, need start process when image displayed on screen.

how may know image loaded , displayed, , not still being processed uiimageview ?

well... first thing shouldn't setting 5mp image in imageview. imageview meant on screen display , though scales image set display purposes original retained memory footprint goes way up. if @ best have poor performing app deals lots of memory warnings. @ worst, you'll crash often.

so, should resize image smallest size meets onscreen display needs , set image within imageview. favorite blog post on how resize images: http://vocaro.com/trevor/blog/2009/10/12/resize-a-uiimage-the-right-way.

now, question. can't know sure when image displayed happen once scaled can assume displayed set it. scaling on background thread. when scaling done, send message main thread set scaled image in imageview , whatever want.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -