zoukankan      html  css  js  c++  java
  • iOS 图片加文字水印

    - (UIImage *) addText:(UIImage *)img text:(NSString *)mark {

        

        int w = img.size.width;

        int h = img.size.height;

        

        UIGraphicsBeginImageContext(img.size);

        

        [[UIColor redColor] set];

        [img drawInRect:CGRectMake(0, 0, w, h)];

        

        NSDictionary *dic = @{NSFontAttributeName:[UIFont systemFontOfSize:20],

                              NSForegroundColorAttributeName:[UIColor redColor]};

        

        CGFloat pointX = w - 200;

        CGFloat pointY = h - 100;

        

        [mark drawInRect:CGRectMake(pointX  , pointY, 150, 100) withAttributes:dic];

        UIImage *aimg = UIGraphicsGetImageFromCurrentImageContext();

        UIGraphicsEndImageContext();

        return aimg;

    }

  • 相关阅读:
    堆排序
    阿里云
    ubuntu下编译内核模块
    字节对齐
    线段树
    c++虚函数表解析
    电面
    sql server数据库定时自动备份
    [hiho1584]Bounce
    五彩斑斓的世界
  • 原文地址:https://www.cnblogs.com/poky/p/5329039.html
Copyright © 2011-2022 走看看