I have a image in rectangle shape but i want to crop this image in a star shape in my iphone application. so please can any one suggest how i do this? plz suggest. thanks
See the comment to a related question on how to mask an image. The magical part is CGContextClipToMask.
Related
Is there any way to mask the some image into particular portion of the another image.
I have an image like this :-
Image 1
and I want to mask the another image 2 into the black area of the image 1.
IS it possible.If yes then please tell me how is it possible.
I know i can mask the image like :-This But i will alow me to mask the whole image.I want to mask the image into particular portion of the image.
Thanks in advance
I want to cut a part of large image with the shape of a small image. Is there any way to find the exact shape of small image instead of making rect of that image using boundingBox? Please reply..
You could do it by masking the bigger sprite with the smaller one.
Here you have a great tutorial on that:
http://www.raywenderlich.com/4421/how-to-mask-a-sprite-with-cocos2d-1-0
And here is the tool that they use to play with the blending functions
http://www.andersriggelsen.dk/glblendfunc.php
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
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.
I am in a situation in which I need to display particular pixels of an Image in an ImageView.
Is there any way to do this in iPhone?Can anybody provide some Example code to do this?Please help me to solve this problem.
There are many ways to display a small subset of your pixels. You can get the raw pixels with this.
Or you can crop a photo. Or you can mask a photo so you are left with just a small bit of your image.
What exactly do you mean by "display particular pixels"?