第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

我想要的是區(qū)域截圖,我要設(shè)置origin坐標,然后設(shè)置width和height,請問怎么做?

我想要的是區(qū)域截圖,我要設(shè)置origin坐標,然后設(shè)置width和height,請問怎么做?

iOS
躍然一笑 2023-04-26 19:15:35
我現(xiàn)在使用如下方法對屏幕截圖:UIGraphicsBeginImageContext(self.view.bounds.size);[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];currentCaptureImage = UIGraphicsGetImageFromCurrentImageContext();UIGraphicsEndImageContext();
查看完整描述

2 回答

?
汪汪一只貓

TA貢獻1898條經(jīng)驗 獲得超8個贊

CGRect rect =self.view.frame;
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurrentContext();
[self.view.layer renderInContext:context];
UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

float originX ;
float originy ;
float width ;
float height ;
//你需要的區(qū)域起點,寬,高;

CGRect rect1 = CGRectMake(originX , originY , width , height);
UIImage * imgeee = [UIImage imageWithCGImage:CGImageCreateWithImageInRect([img CGImage], rect1)];


查看完整回答
反對 回復 2023-04-29
?
PIPIONE

TA貢獻1829條經(jīng)驗 獲得超9個贊

主要就是下面這句

UIImage *resultImg = [UIImage imageWithCGImage:CGImageCreateWithImageInRect(img.CGImage, rect)];


查看完整回答
反對 回復 2023-04-29
  • 2 回答
  • 0 關(guān)注
  • 316 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號