[superviewDidLoad];.
selectingButtonImage = NO ;
selectingImageViewImage = NO;
UIImage * scaledButtonImage = [buttonImagescaleToSize: CGSizeMake (120.0f, 120.0f)];
UIImage * scaledImageViewImage = [imageViewImagescaleToSize: CGSizeMake (100,0 f, 100.0f)];
[buttonsetImage: scaledButtonImage forState: UIControlStateNormal];
[imageViewsetImage: scaledImageViewImage];
}
- (void ) viewWillAppear: (BOOL) geanimeerde {
[superviewWillAppear: geanimeerde];
UIImage * scaledButtonImage = [buttonImagescaleToSize: CGSizeMake (120.0f, 120.
0f)];
UIImage * scaledImageViewImage = [imageViewImagescaleToSize: CGSizeMake (100.0f, 100.0f)];
[buttonsetImage: scaledButtonImage forState: UIControlStateNormal];
[imageViewsetImage: scaledImageViewImage];
}
- (IBAction) photoButtonPressed {
UIImagePickerController * imagePicker = [[UIImagePickerControlleralloc] init];
imagePicker.
delegate = zelf;
selectingButtonImage = YES ;
[selfpresentModalViewController: imagePicker geanimeerd: JA];
[imagePicker vrijlating];
}
- (IBAction) selectImageViewImage {
< p> UIImagePickerController * imagePicker = [[UIImagePickerControlleralloc] init];
imagePicker.delegate = zelf;
selectingImageViewImage = YES;
[selfpresentModalViewController: imagePicker geanimeerd: JA];
[imagePicker vrijlating];
}
- (void) imagePickerControllerDidCancel: (UIImagePickerController *) picker {
[selfdismissModalViewControllerAnimated: JA];
}
- (void) imagePickerController: (UIImagePickerController *) picker didFinishPickingImage: (UIImage *) selectedImage editingInfo: (NSDictionary *) editingInfo {
als (selectingButtonImage) {
CGSize size = selectedImage.
size;
CGFloat ratio = 0;
als (size.width> size.height) {
ratio = 128,0 /size .width;
} else {
ratio = 130,0 /size.height;
}
CGRect rect = CGRectMake (0.0, 0.0, verhouding * size.width, verhouding * size.height);
UIGraphicsBeginImageContext (rect.size);
[selectedImage drawInRect: rect];
buttonImage = UIGraphicsGetImageFromCurrentImageContext ();
}
als (selectingImageViewImage) {
CGSize size = selectedImage.size;
CGFloat ratio = 0;
als (grootte .width> size.height) {
ratio = 128,0 /size.width;
} else {
ratio = 130,0 /size.
height;
}
CGRect rect = CGRectMake (0.0, 0.0, verhouding * size.width, verhouding * size.height);
UIGraphicsBeginImageCo