ios - Manipulating UIImages for high resolution -
i trying build app allows user combine 2 uiimages, i've got no problem using core graphics. user able pan , resize photo in view , combining result of views in image context.
the size of combined photo small saving visible portion of image in view in. avoid shrinking photo , scaling up, have provide view user alter photo , apply changes (at correct scale) full size photo?
i appreciate help, if above confusing can provide code example, trying see if i'm heading down right road or if there better way...
thanks
to avoid shrinking photo , scaling up, have provide view user alter photo , apply changes (at correct scale) full size photo?
yes, if shrink image start (to display user , allow user manipulations) must not throw away original , scale shrink image again. must keep original , operate upon it. otherwise, lose lots of pixels forever.
however, why bother? display shrink the way image drawn you. if show large image in uiimageview, using aspect fit mode, drawn within image view , have not had shrinking yourself. if set calayer's contents
cgimage , layer's contentsgravity
kcagravityresizeaspect
, image drawn within bounds of layer.
so operations (drawing coregraphics) @ full size - actual bitmap target of manipulations. let display performed you.
(if had several dozen images, yes, terrible strain hold them @ full size in memory; crash app. 1 image should fine. this, after all, how photos app works.)
Comments
Post a Comment