iphone - recreating uiimage smaller or not in bounds of the containing view -
i'm trying enable resizing , moving of image within view. doing so, challenge not lose image quality. have uiimageview
placed inside uiview
(i'm not using uiscrollview
implementing it, found not suitable case) , i'm following uipangesturerecognizer
, uipinchgesturerecognizer
dragging , zooming.
the problem when i'm trying recreate new image in boundaries of uiview
: if uiimageview
in boundaries of uiview
it's fine, taking visible rect scaling according cgimagecreatewithimageinrect
. however, if inner uiimageview
smaller uiview
(zoom-out) or moved doesn't cover whole uiview
, creates image in original size, or not in position intending.
the solution works renderincontext , makes image of visible in uiview
- image quality drastically reduced.
is there way without losing image quality? maybe add edges 0 alpha, suit frames of uiview
, yet suits memory demands?
if change frame of uiimageview should handle scaling based on content mode, should have set scaletofill probably. not sure why messing around cgimage stuff (unless trying recreate image ...).
or have misinterpreted trying achieve?
Comments
Post a Comment