Снимок экрана для iOS [дубликат]
На этот вопрос уже есть ответ здесь:
iOS Скриншот часть экрана 4 ответая использую эти коды для захвата экрана для iOS:
CGImageRef screen = UIGetScreenImage();
UIImage *image = [UIImage imageWithCGImage:screen];
CGImageRelease(screen);
UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:didFinishSavingWithError:contextInfo:), nil);
CGRect screenshotFrame;
CGImageRef screenshotRef = CGImageCreateWithImageInRect(screenshotRef, screenshotFrame);
UIImage * screenshot = [[(UIImage *)screenshotRef retain] autorelease];
CGImageRelease(screenshotRef);
Но мой экран содержит панель инструментов в нижней части экрана.Не хочу панель инструментов на моем захваченном экране. Как я могу обрезать панель инструментов? Как я могу изменить свой код?