Fade Image to Transparent in iOS - iphone

I am just starting out with iOS development. I'm trying to determine if this is possible in iOS and I'm new enough that I don't know what to search for, so please excuse my ignorance.
I'm going to be saving a few images in the application and the primary image will fade over another image like so:
Image A will still need to be a solid image, so my question "Is it possible to create a gradient mask that only fades for 50px from the bottom (transparent) of an image?"
Sorry if this is a basic question and since I don't know where to start I don't have any code to request help on. Any help would be appreciated! :)

Yes, it is definitely possible.
You will need to draw the images in a CGContext. Basically you would first draw image b first then draw image 'a' with an alpha mask using CGImageCreateWithMask.
It is very straight forward. See here for an example.

Related

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

How to clear the selected point color of UIImageView?

I am creating an app that has drawing module and what i am try to do that i have a image and i have to draw text on it.Now i need to remove the text by eraser and draw pad(UIImageView) height must be infinite.So i need to scroll the image View as well as apply drawing on it also.If anyone have any answer then please reply
I had answered a question like this before .... Maybe this would help you :) Also you would see a long discussion which I think would be helpful ....
Writing on ImageView in Iphone

Cut/Slice UiImage using coordinations

I have an image that I want to slice like the photoshop knife tool using two or more coordinations on the image. I then want to erase the top portion of the image and replace it with a transparent background. If anyone can point me in the right direction or has code that can do it I would be forever grateful.
I think that you should try using a UIGraphicsContext. Here is a similar question, I hope it helps.
Slicing up a UIImage on iPhone

iOS Trim Square Image to make rounded app like in app store

I'm grabbing app images from the iTunes affiliate program. Unfortunately Apple provides a square .jpg image which does not have the smooth rounded edges. How can I programmatically take the provided image and round the edges?
The only way I can think of how to do this is set the image as the background of a view, and then round the layer borders until it cuts off what I don't want to see. Is this a good approach?
I don't see any problem with that approach, I was going to suggest the same thing.

how to animate some portion of images?

I am implementing fun application.In which i want to animate some area(portion) of images.
I dont know how it possible.If u have any idea then please help me.
If you're looking to animate a portion of an image you could just create a smaller animation and put it at the right relative location inside a larger image.
If you want to know how to animate images in general, that's a different question entirely.