切割图片

 

- (UIImage*)imageWithImageSimple:(UIImage*)image scaledToSize:(CGSize)newSize

{

    // Create a graphics image context

    UIGraphicsBeginImageContext(newSize);

    

    // Tell the old image to draw in this new context, with the desired

    // new size

    [image drawInRect:CGRectMake(0,0,newSize.width,newSize.height)];

    

    // Get the new image from the context

    UIImage* newImage = UIGraphicsGetImageFromCurrentImageContext();

    

    // End the context

    UIGraphicsEndImageContext();

    

    // Return the new image.

    return newImage;

}

posted @ 2013-06-14 11:40  xiaoxiaoxigua  阅读(148)  评论(0编辑  收藏  举报