Xin chào Tôi cố gắng chụp một khung nhìn rồi lưu dưới dạng hình ảnh vào Thư viện ảnh, nhưng tôi cần tạo độ phân giải tùy chỉnh cho hình ảnh đã chụp, đây là mã của tôi nhưng khi ứng dụng lưu hình ảnh độ phân giải chậm !iOS: Lưu hình ảnh với độ phân giải tùy chỉnh
UIGraphicsBeginImageContextWithOptions(self.captureView.bounds.size, self.captureView.opaque, 0.0);
[self.captureView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage * screenshot = UIGraphicsGetImageFromCurrentImageContext();
CGRect cropRect = CGRectMake(0 ,0 ,1435 ,1435);
CGImageRef imageRef = CGImageCreateWithImageInRect([screenshot CGImage], cropRect);
CGImageRelease(imageRef);
UIImageWriteToSavedPhotosAlbum(screenshot , nil, nil, nil);
UIGraphicsEndImageContext();
nhưng độ phân giải trong iPhone là: 320 x 320 và võng mạc là: 640 x 640
tôi sẽ biết ơn nếu bạn giúp tôi khắc phục vấn đề này.
[SupportingHiResScreens] (http://developer.apple.com/library/ios/#documentation/2DDrawing/Conceptual/DrawingPrintingiOS/SupportingHiResScreens/SupportingHiResScreens.html)> [ Tạo hình ảnh bitmap có độ phân giải cao theo lập trình] (http://developer.apple.com/library/ios/#documentation/2DDrawing/Conceptual/DrawingPrintingiOS/SupportingHiResScreens/SupportingHiResScreens.html#//apple_ref/doc/uid/TP40010156-CH15- SW9) – Bala
http://stackoverflow.com/a/613576/1059705 – Bala
kích thước hình ảnh nào bạn chọn từ Thư viện ảnh? Lớn hơn hoặc nhỏ hơn kích thước mong muốn của bạn (1435, 1435)? – holex