zoukankan      html  css  js  c++  java
  • 绘画字符串

      CGContextRef context = UIGraphicsGetCurrentContext();//获取绘画上下文

        

        UIColor *color = [UIColorcolorWithRed:0.8green:0.2blue:0.3alpha:0.9];

        

        CGColorRef aCGColor = color.CGColor;//设置绘画颜色

        

        CGContextSetFillColor(context, CGColorGetComponents(aCGColor));//绘画的填充颜色

        

        CGContextSetFlatness(context, 1);//设置绘画平整度

        

        CGContextSetFontSize(context, 20.0f);//设置大小

        

        CGContextSetCharacterSpacing(context, 5.0f);//设置字符之间的间距

       

        CGContextFillRect(context, CGRectMake(0.0f, 0.0f, 320.0f, 480.0f));//填充的区域大小

      

        CGContextSetStrokeColor(context, CGColorGetComponents([UIColoryellowColor].CGColor));//设置线框的颜色

     

        NSString *str = @"HELLO";

        

        NSMutableAttributedString *str0 = [[NSMutableAttributedStringalloc ]initWithString:str];

        

        

        [str0 drawWithRect:CGRectMake(100.0f, 200.0f, 100.0f, 30.0f) options:NSStringDrawingUsesDeviceMetricscontext:nil];//字符串自己的放法进行绘画

  • 相关阅读:
    实验三
    实验二 结对四则运算
    实验一 小学四则运算修改版
    实验一 小学四则运算
    JS 原型链学习总结
    JS function的定义方法,及function对象的理解。
    JS 点击事件学习总结
    JS 样式操作学习总结。
    js各种间距数据汇总
    css-display
  • 原文地址:https://www.cnblogs.com/leevaboo/p/3549499.html
Copyright © 2011-2022 走看看