Closed shubhank008 closed 10 years ago
tool.available = NO;
Is it possible to center the tools ? I am using it for a iPad app in landscape mode (more editing area) and tools are kinda aligned to left only
It is not possible in default. You should rewrite the code yourself.
this is a downer for ipad use :/ Can you hint me at the particular code or files I should try to modify to make that centered
When it comes to menu layouts, how about #49 ?
wow thanks, I think I found out what I was looking for :)
Question: In your sample code we are pushing editor on a pickerVC, so after image is done edited I push it to another VC and dismiss the editor Now what if I want to come back to re-edit the image from my preview VC
If I don't dismiss the editorVC, even after my sugue push to previewVC editor window stays on top, and if I dismiss it and come back from previewVC, I return to my initial screen to select image rather then re-edit current image edit.
Any work around for this ? I am pretty sure its related to pushing or presenting editorVC on my main nav bar or something but just want some hints
My last question to you after above if you don't mind, is there any way to display a "image mask" like a guideline while editing main image ?
I am creating a app for a edible paper print app and the edited image is placed in circle/square templates of a page, so once we put it and any frame/sticker/text goes out of bound in template, we need to edit it from start
So if a mask of the template was available over image while editing, taht would be perfect
Regarding the first question, I couldn't understand what is a problem.
About image mask, I think that you should to modify the code to suit the purpose.
Basically I was asking when we click done and in delegate push view to a new VC, and form that VC want to come back to the editor to again keep re-editting same image (kind of image edit session), to do that is.
I will check the code where CLIE creates the main view to see if its just as simple as adding a imageview and decrease its alpha
It seems to me that the editor keeps editing result, is it wrong? Or you mean you want to rollback to the initial image?
nope since you dismiss editor VC, so when to return back it doesn't exist anymore, and you are back to initial screen from where you pick the images (a separate VC)
My code
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage];
//Image Editor Init
editor = [[CLImageEditor alloc] initWithImage:image];
editor.delegate = self;
//NSLog(@"%@", editor.toolInfo);
NSLog(@"%@", editor.toolInfo.toolTreeDescription);
CLImageToolInfo *tool = [editor.toolInfo subToolInfoWithToolName:@"CLToneCurveTool" recursive:NO];
tool.available = NO; // if available is set to NO, it is removed from the menu view.
CLImageToolInfo *tool2 = [editor.toolInfo subToolInfoWithToolName:@"CLDrawTool" recursive:NO];
tool2.available = NO;
CLImageToolInfo *tool3 = [editor.toolInfo subToolInfoWithToolName:@"CLStickerTool" recursive:NO];
tool3.title = @"Icons"; // if available is set to NO, it is removed from the menu view.
CLImageToolInfo *tool4 = [editor.toolInfo subToolInfoWithToolName:@"CLEmoticonTool" recursive:NO];
tool4.title = @"Frames";
[picker pushViewController:editor animated:YES];
}
- (void)imageEditor:(CLImageEditor *)editor didFinishEdittingWithImage:(UIImage *)image
{
//self._imageView.image = image;
//[self refreshImageView];
[editor dismissViewControllerAnimated:YES completion:nil];
FPdataModel *dm = [FPdataModel sharedManager];
dm.tmpMainImg = image;
FPAppDelegate *app = (FPAppDelegate *)[[UIApplication sharedApplication] delegate];
UIViewController *currentController = app.window.rootViewController;
_svcNav = (UINavigationController*)currentController;
[self performSegueWithIdentifier:@"previewVC" sender:nil];
}
//Selector to return back to editor, from my preview VC
-(void)didExitEditing:(NSNotification*)notify{
FPAppDelegate *app = (FPAppDelegate *)[[UIApplication sharedApplication] delegate];
[UIView transitionWithView:self.navigationController.view.window
duration:0.65
options:UIViewAnimationOptionTransitionFlipFromRight
animations:^{
app.window.rootViewController = _svcNav;
}
completion:nil];
}
What's wrong with pushing preview VC?
- (void)imageEditor:(CLImageEditor *)editor didFinishEdittingWithImage:(UIImage *)image
{
if([editor.parentViewController isKindOfClass:[UIImagePickerController class]]){
UIViewController *vc = your preview VC
[(UIImagePickerController*)(editor.parentViewController) pushViewController:vc animated:YES];
}
}
And why don't you change an image by [[CLImageEditor alloc] initWithImage:image]
?