Home one image on to another image size issue ios
Reply: 0

one image on to another image size issue ios

user1520 Published in March 23, 2018, 10:33 pm

I want to add one small image to another main image something like badge I am doing this code for this but problem is if background image is small then watermark is showing very large. Please provide any advice.

[_productImg sd_setImageWithURL:[NSURL URLWithString:imgUrl]
                          completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {

                              if (image.size.width > 0 && img.isdefaultImage) {
                                  UIImage *watermark = [UIImage imageNamed:@"is_default_big"];
                                  CGFloat scale = image.scale;
                                  UIGraphicsBeginImageContextWithOptions(image.size, NO, 0.0);
                                   [image drawInRect:CGRectMake(0, 0, image.size.width, image.size.height)];
                                  [watermark drawInRect:CGRectMake(image.size.width - watermark.size.width, 0, watermark.size.width, watermark.size.height)];
                                  UIImage *result = UIGraphicsGetImageFromCurrentImageContext();
                                  _productImg.image = result;


                              [_spinner stopAnimating];
                              [_spinner removeFromSuperview];



You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.318493 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO