Creating a 3D Border for an ImageView in iOS - ios

I am working on an application which is used to change the orientation of the Image view and also provide a shadow to it. I have succeeded in that and the only obstacle remaining here is the fact that I have not been able to provide a 3D border to it as shown in this Image.
Look at the 3D border on the left and Bottom edge of this image view.
Please guide me to create this effect.
Thanks in advance.

Related

In iOS, is there a method to make a button move around arc line or circle?

I have a custom control like the picture below, it is too complicated to draw all the images using core graphics. So I use the images designer give, but the problem is how to make the small circle(which is actually a button) on the big white circle(which is an UIImageView) move aroud the big circle? Thanks in advance!
You need to calculate all circumference points. Just set centre of your image to the points calculated by you. Automatically your image will start moving in circle.

How to create a non-rectangular UIImageView

I'm trying to make a ViewController that presents info from a webpage like this:
However, I'm confused on one thing. How did they get the imageView to display an image that's cut off at the corner, i.e. not rectangular? Do you think they created that player card in Photoshop and used it as the background for the imageView image, or did they create it programmatically?
I wonder because the image is behind the picture of the bear, so I imagine if they created the background in Photoshop, how would they get the image behind the bear head? They can't have just created the card with the player's picture as part of it, then loaded the whole image because if they traded the player, because I'm sure they pull the player info and picture from the web so they can have a card for all players, even if they trade or acquire a new player mid-season, without having to update the app (and add the finished image to images.xcassets).
This can be composed from two CALayers at runtime. Put the picture on the bottom layer; the picture can come from anywhere - the web, the bundle, etc. the image source could be dynamic.
Put another CALayer on top, with the frame rendered with opaque colors, and a transparent cut-out for the picture in the middle:
There are a bunch of ways to do this. A simple and flexible way to do it is to create a CAShapeLayer that's the same size as the image view, with it's origin at 0,0, and add it as the UIImageView's layer's mask.
You'd create a filled UIBezierPath that maps out the part of the image you want to show, and install the bezier path's CGPath into the mask layer's path property.
The result would be that the image view is cropped so that only the part inside the shape is drawn.

How to dim/blur everything outside given rect in iOS?

I'm currently developing an iOS app that is using OCR.
Currently I'm using AVFoundation to preview the video from the camera (using Apples sample AVCam).
For a good user experience I want to lay out a rectangle in the preview layer. The image inside this rectangle will be the image parsed by the OCR engine. My problem is that I also would like to "dim" everything outside this rectangle and I'm currently out of ideas how to solve this. Does anybody know how to do this?
Edit
This is what I would like to accomplish (image taken from the app Horizon):
http://i.imgur.com/MuuJNS9.png
You can use two black images covering the top and bottom areas that you want to "dim", set the alpha of those images to a certain value, like 0.5.
Why not add a subview that covers the entire screen and set the background color to a semi transparent gray - your gray overlay?
And then add the image parsed by the OCR engine add a subview of this grayoverlay int the center of it

iOS: Ensure that an image has got no empty area after manual rotation

I have got an UIImageView in which the image can be rotated using UIRotationGestureRecognizer.
Based on the UIImageView a frame in the middle of the screen is extracted from the image.
For the better understanding here's a little screenshot:
http://d.pr/i/hzhA
As you can see there's an empty area at the right edge within the target frame.
The Question is: How can I check if there is an empty area within the target image, for example in the right top area of the target frame (as you can see in the screenshot).
Any help will be highly appreciated.
Regards,
Christian

How to make square overlay appear with touch?

The app that I'm currently working on is supposed to overlay a square image. The square image would overlay on preview camera screen wherever the user touches the screen.
I'm having hard time figuring this out. Guidance would be really helpful.
Apple has sample code that overlays points of interest on top of the camera view.
They have another sample that overlays a square.

Resources