zoukankan      html  css  js  c++  java
  • ios-UIKit 练习

    没有上下文,没有渲染画图

    //
    //  HMView.m
    //  UIKit练习
    //
    //  Created by YaguangZhu on 15/9/9.
    //  Copyright (c) 2015年 YaguangZhu. All rights reserved.
    //
    
    #import "HMView.h"
    
    @implementation HMView
    - (void)drawRect:(CGRect)rect {
        // Drawing code
        UIImage *image = [UIImage imageNamed:@"jiangxin"];
        // 裁剪区域,外面都不显示
        UIRectClip(CGRectMake(0, 0, 100, 100));
       // [image drawAtPoint:CGPointZero];
        [image drawAsPatternInRect:rect];
    }
    
    - (void)drawText
    {
        NSString *text = @"sdddfffffffffffffgrgijperwpjprthrjtjreptrhkrht";
        CGRect textFrame = CGRectMake(0, 0, 250, 250);
        NSDictionary *dict = @{NSFontAttributeName:[UIFont systemFontOfSize:20],
                               NSForegroundColorAttributeName:[UIColor redColor],
                               NSStrokeWidthAttributeName:@5
                               };
        UIRectFill(textFrame);
        //不会换行
        //[text drawAtPoint:CGPointZero withAttributes:dict];
        [text drawInRect:textFrame withAttributes:dict];
    }
    @end
  • 相关阅读:
    【CF932E】Team Work
    【ZJOI2011】看电影
    【CQOI2011】放棋子
    【HAOI2010】计数
    【HNOI2009】有趣的数列
    【ZJOI2010】排列计数
    【FJOI2016】建筑师
    【USACO10 OPEN】三角形计数
    【HNOI2012】排队
    【HNOI2008】越狱
  • 原文地址:https://www.cnblogs.com/zhuyaguang/p/4795844.html
Copyright © 2011-2022 走看看