Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 3    Views: 41

NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
12/07/14 12:55 AM (9 years ago)

Mosaic Gallery - saving zoomed image

Hopefully this helps others - A nice write-up on saving/loading image data: http://blog.teliaz.com/2010/capture-saveloadremove-image-in-documents-directory This works great to save the ENTIRE image when using code similar to code below: // convert UIImageView to UIImage UIImage *myZoomedImage = imageview.image //<- entire image //save to documents directory [self saveImage: myZoomedImage: @"myUIImageName"]; ================================================= I have temporarily added it to AK_GalleryPhotoView.m scrollViewDidEndZooming until I have an action button. Now for my question How would I CREATE A UIIMAGE that references the existing ZOOMED area displayed in the UIImageView rather than the size of the original image? replace "imageview.image" with... (some code referencing Current Context) Thanks
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
12/07/14 08:00 AM (9 years ago)
A guess before getting out of bed this morning ... I would imagine the Frame and maskToBounds would be factors in the solution.
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
12/07/14 12:10 PM (9 years ago)
Thanks- have taken the hints and searched online and tried various approaches. Each one felt like reinventing the wheel, as Kittsy already has equivalent methods in the plugin. Most info out there is on creating the zoomed view. Three strikes today so... Time to push away from the keyboard and get some Christmas lights on the house ;)
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
12/07/14 12:20 PM (9 years ago)
This is a useful link for others interested in scaling images: http://www.icab.de/blog/2010/10/01/scaling-images-and-creating-thumbnails-from-uiviews/ Think I have found the answer. I should have been looking at Image Cropping from a UIScrollView... https://codefuel.wordpress.com/2011/04/22/image-cropping-from-a-uiscrollview/ Will try tonight :)
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.