zoukankan      html  css  js  c++  java
  • IOS截取部分图片

    截取部分图片这么简单:

    - (void)loadView { 
        [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation: UIStatusBarAnimationSlide]; 
        UIImage *image=[UIImage imageNamed:@"1.jpg"]; 
        
        
        CGRect rect = CGRectMake(60, 80, 331, 353);//创建矩形框 
        UIImageView *contentView = [[UIImageView alloc] initWithFrame:rect]; 
        contentView.image=[UIImage imageWithCGImage:CGImageCreateWithImageInRect([image CGImage], rect)]; 
        
        self.view=[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]; 
        [self.view addSubview:contentView]; 
        
        [image release]; 
    }

    虽然编写代码的过程是曲折的,但是摸到很多有用的东西,都是以后要用到的。

  • 相关阅读:
    hdu 6201 dfs
    Oulipo POJ
    Kitchen Measurements UVALive
    Surf Gym
    hoj 13969 Racing Gems
    分块
    分块学习资料
    Jam's problem again HDU
    树的点分治
    Census UVA
  • 原文地址:https://www.cnblogs.com/lgphp/p/4109604.html
Copyright © 2011-2022 走看看