UIImage resize, crop and rotate with frame - iphone

I'm searching for library or just code snippet to provide function like resize, crop with frame and rotate image after user pick image from image picker. Something like on this video: http://www.youtube.com/watch?v=Gb6xncXg1PY (0:55). Maybe someone has the same issue?

This one could help you relating the images. It's for iPad but this shouldn't make much differences. The principles should be the same. (icodeblog.com is really a good page, could be that there is much more relating this issue)
http://icodeblog.com/2010/10/14/working-with-uigesturerecognizers/
But there are also so much out which you can find via Google. I had a good one but I don't find it anymore.

Related

Unity Pixel Art Menu

As a beginner on Unity, I'm looking for a solution to a rather annoying problem. I've been through a lot of videos and articles, but I still can't solve it.
On a blank Scene, in a Canvas containing a Panel and an Image. I'm trying to display this image correctly. It is a pixel art image.
The problem is that it remains blurred and badly arranged according to the resolutions.
I try to find a way to display it correctly while keeping its pixel art aspect.
(I looked at the pixel perfect cameras, the stretch settings and others, I set the sprite parameters to Point and No compression and others. But nothing works).
I don't know how to propose different types of zoom according to the resolution and that the image doesn't blur
If someone has a little time, and can make me a scene just with his camera, and therefore the canvas, panel and image, with good setting so that I can understand my error. It would be a great help for me !
Thanks for reading !
The background picture :
Try selecting the image in the assets and change the Resize algorithm to Point(no filter)
Hop, I found the solution thanks to this threed :
Official - Pixel Perfect Preview Package
By looking correctly at the settings apply. It came from the resizing of the Canvas and the management of the Camera.
Thanks for your messages !
And thanks to the author of the threed : rustum !

How to take UIView screenshot in which AVPlayer is playing?

I am trying to generate a video from the screenshots taken from a specific UIVIew. This view have an AVPlayer subview and also a canvas subview(in which we can draw shapes). Just tried the normal way of UIGraphicsGetImageFromCurrentImageContext and the screenshot was black. I think its because the video is rendered in GPU.
So I tried to take a screenshot of a GLKView to which the above two subviews were added. But still its giving the GLKView background colour as images. Referred the below two links for my purpose.
Tried adding glkview as in this post.
Taking screenshot from a GLKView
Am I going the right way? If yes, Please help me to understand what I am missing.
OR
Is there anyother better way to do this? AVAssetImageGenerater is not at all suitable for my requirement and so I cant use it too.
AVAssetImageGenerater is not at all suitable for my requirement and so
I cant use it too.
What is the reason for this i don't know but by using AVAssetImageGenerater it is possible to take snap of the video and draw the snap image over the screenshot image is easy as you know the frame of the black part.
See below post to put a UIImage over another UIImage.
Draw another image on a UIImage

UITableViewCell Background stretching

I have a problem in Swift with UITableViewCell background image. Let's say that it shows quite fine one iPhone5 but on iPhone 6Plus it is stretch and thus it looks bad. This is probably due to Aspect fill or something which I really couldn't manage to change and achieve what I want so would be the best if someone could poke sample code I am providing as well as image how it should look, so anyone can check it out and maybe give me some hint or tip or sample code or even fixed demo version.
So here it is:
Note that on left side there is a curve (like half a circle) around right side of icon. On bigger phones or tablet, that curve gets super stretch thus completely destroying the look.
Demo code link
Thanks all in advance for any help. I am pretty stuck with this one.
You can stretch an image while preserving the aspect ratio of a portion of that image using slicing. Xcode offers a graphical interface for doing this. The idea is that you decide what parts of the image are allowed to stretch and which aren't.
https://developer.apple.com/library/ios/recipes/xcode_help-image_catalog-1.0/chapters/SlicinganImage.html

Zooming a hotspot when it clicked

I have to make some hot spots on my image , so that when i click anyone of them they zoom.
For example consider the image
When i click that butterfly then it zoom
Please provide a good solution
Following are my thinking
Use a button and click it and add a subImageView and zoom it.
Zoom a particular region of this image when touch at that place.
Both ideas have their limitations.In first i have to create a saperate image and also my app size will become very large.
and limitation of second is that it will not zoom exact required image.
I was also thinking of masking but i think that is also not very good way, because this is just a sample, i have many images like this and can be many hot spots on a single image.
please guide.
If you are dealing we rather large images you should check out CATiledLayer, which are very fast and efficient to use.
Check out this blog post, including the demo app:
http://www.cimgf.com/2011/03/01/subduing-catiledlayer/

Show photo with SCRATCH OUT EFFECT by finger

I need your help to know how to create an iPhone application to show a photo with SCRATCH OUT EFFECT.
Something like the effect in this flash tutorial
http://www.tutorial5.com/content/view/115/46/
Please help.
Thanks.
You can have a look at the following post on how to create a blurred image effect, I don't think it's the best & fasted method, but it might get you started:
UIImage blur
You can implement the scratch out effect by using CoreGraphics.
Subclass UIView for the scratchable image.
Draw the scratchable image, use a mask to cut out the parts of the image that gets "scratched".
Each time the user scratches the image, make it so the mask and the image gets updated.
Full code example on github