UIImage *image = [UIImage imagenamed:@"yourImage.png"];CGImageRef tmpimgRef = image.CGImage;CGImageRef topimgRef = CGImageCreateWithImageInRect(tmpimgRef,CGRectMake(0,image.size.wIDth,image.size.height / 2.0));UIImage *topImage = [UIImage imageWithCGImage:topimgRef];CGImageRelease(topimgRef);CGImageRef bottomimgRef = CGImageCreateWithImageInRect(tmpimgRef,image.size.height / 2.0,image.size.height / 2.0));UIImage *bottomImage = [UIImage imageWithCGImage:bottomimgRef];CGImageRelease(bottomimgRef);
希望这可以帮到你,:)
总结以上是内存溢出为你收集整理的ios – 将UIImage分成两半?全部内容,希望文章能够帮你解决ios – 将UIImage分成两半?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)