How to set the shadow color for Image? - iphone

Hai, I am doing one application, in that i want to provide the shadow color for image after setting the border color. But border color and shadow color both are different. So please tell me any more suggestions.

Have you looked at CALayer? It has a property called shadowColor. This works you are referring to an UIImageView object. If you're referring to the image, you can look at CGContextSetShadowWithColor to add an image using Quartz.

Related

How to change the corner positions of UIImageView?

I want to show a bellow image using UIImageView.
is it possible to show by UIImageView or any other way we can show it.
Please help me.
You need following type of design from your designer :
In above image. White part inside the red box will be transparent. And then you can set this image to UIImageView

Set alpha on one color in UIImage

I have this PNG image: (the area in the grey borders is transparent)
I would like only the grey corners to have alpha of 0.5
If I set
[imgView setAlpha:0.5f];
Also the transparent area in the middle retrieves a semi-white color.
How can I do it?
Any reason why you don't just change the original image file? If that's not possible, you could put a white (black?) rectangle with 50% opacity below the image.
Of course there are many ways to do this but you would need to tell us more about your use case.
You should add one imageview below your desired image. and adjust alpha of that image.

Iphone Set background image into text in uitextView?/

I have a uiimageView containing the text like this.
I want to set the image background of the text to look like this instead.
Please help me! Thanks!
You will need to combine an image of the text with the background image (the stuff that is supposed to fill the inside of the text) using compositing. Take a look at the various blend modes you can use, or look into the use of CIFilter.
http://developer.apple.com/library/ios/#documentation/GraphicsImaging/Reference/CGContext/Reference/reference.html#//apple_ref/doc/c_ref/CGBlendMode
https://developer.apple.com/library/mac/#documentation/graphicsimaging/Reference/CoreImageFilterReference/Reference/reference.html
The thing in the background looks like it might be a gradient. Again, you can use a CIFilter to generate that gradient, or you can use Core Graphics. So you'll composite the drawn text with its fill image, then you'll draw that over a gradient.
instead of text in black solid color, make image with transparent text and outer region as the grey gradient you want and put this image over you background image, you will get the desired result.

How to mask image with color in iOS?

Basically I want to remove the background color of image from image.
that why I want to mask my image with clear color, it can make the image transparent.
or do we have any other way to clear the backgrund color of image and get transparent image.
Create a new image with by masking background using CGImageCreateWithMaskingColors. Specify the background color range(RGB) values. That would be enough to create background transparent image.

Text Engraving effect in UILabel

How can we bring the Engraved effect of a UILabel's Text?
I wanted the effect as provided in the snapshot I have provided.
I could not add the image, so I have added the Link where I have hosted it.
Image
If you're using a light text color, set the shadow to a color darker than your text and move the shadow up 1 pixel.
If you're using a dark text color, set the shadow to a color lighter than your text and move the shadow down 1 pixel.