だから私は写真を撮ったときに写真に重ねたいデータを持っています。これが私のコードです。写真にデータをオーバーレイする簡単な方法はありますか?
- (void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingMediaWithInfo:(NSDictionary *)info
{
UIImage *cameraImage = [info objectForKey:UIImagePickerControllerOriginalImage];
UIImageView *imageViewToSave = [[UIImageView alloc] initWithImage:cameraImage];
CGRect textFrame = CGRectMake(0, 0, imageViewToSave.frame.size.width-20, 325);
UILabel *tempLabel = [[UILabel alloc] initWithFrame:textFrame];
tempLabel.text = self.temperatureText.text;
tempLabel.font = self.imageLabelFont;
tempLabel.adjustsFontSizeToFitWidth = YES;
tempLabel.textAlignment = NSTextAlignmentRight;
tempLabel.textColor = self.tempGreen;
tempLabel.backgroundColor = [UIColor clearColor];
[imageViewToSave addSubview:tempLabel];
UIGraphicsBeginImageContext(imageViewToSave.bounds.size);
[imageViewToSave.layer renderInContext:UIGraphicsGetCurrentContext()];
cameraImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
[self.library saveImage:cameraImage toAlbum:@"Node Therma" withCompletionBlock:^(NSError *error)
{
if (error!=nil)
{
NSLog(@"Big error: %@", [error description]);
}
}];
}