0

I'm using two UIImageViews overlay image is having some shapes with white surroundings I need to color only the white surrounding but when I'm selecting color it is applying for complete image.

 UIButton *selectBtn=(UIButton *)sender;
previousButtonTag=selectBtn.tag;
UIImage *selectImg=[self tintedBackgroundImageWithColor:[self.ColorsArray objectAtIndex:sender.tag]];
 OverlayImg.backgroundColor=[ColorsArray objectAtIndex:sender.tag];
CGRect drawRect = CGRectMake(0,0,OverlayImg.image.size.width, OverlayImg.image.size.height);
UIGraphicsBeginImageContextWithOptions(OverlayImg.image.size,0,0);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetBlendMode(context, kCGBlendModeSourceAtop);
selectImg=UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
OverlayImg.image=selectImg;
Indrajeet
  • 5,490
  • 2
  • 28
  • 43
Suneha
  • 119
  • 1
  • 8
  • suggestion : change border collor and make boder width 2~5, NOTE: its just a suggestion i don't know how to implement it – Jageen Dec 12 '14 at 12:06
  • not for the border .check this link... i need to get same as that one https://itunes.apple.com/us/app/frames-delight-pro-frame-pics/id730622888?mt=8.. – Suneha Dec 12 '14 at 12:09
  • Hi, please try this and let me know whether its working or not http://stackoverflow.com/questions/12396236/ios-change-the-colors-of-a-uiimage –  Dec 12 '14 at 12:57
  • His requirement is same as yours, he accepted one answer that might be worked to him..try it.. Happy Coding :) –  Dec 12 '14 at 12:58
  • Thanq @SatyaSwaroopBasangi i'll try it – Suneha Dec 12 '14 at 13:02
  • I got it by using another way..thank you.. – Suneha Dec 16 '14 at 04:58
  • Hi,I'm having one more doubt..I'm taking an array for colors .png [uiimage imageNamed:@"color1.png",etc.. in viewDid load images when i'm executing it is showing exception -[UIImage CGColor]: unrecognized selector sent to instance..But if I use [uicolor blue color],[uicolor purplecolor],etc...in array I'm not getting any exception..Now i need to use .png images for colors array.how to resolve it – Suneha Dec 16 '14 at 05:03

0 Answers0