This is a migrated thread and some comments may be shown as answers.

Show Cropping Editor immediately

1 Answer 51 Views
ImageEditor
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
I Putu Yoga
Top achievements
Rank 1
I Putu Yoga asked on 07 Nov 2013, 07:03 PM
Hi, thanks for this awesome tool. I have a problem here, How can i prompt user to immediately crop the image then show the image editor after that ? Example like set as lockscreen image from photos, you'll be prompted by system to crop the image first to fit the ratio aspect.

...and this is my simple idea, first i use PhotoChooserTask, then i want crop before assign it to image editor

void task_Completed(object sender, PhotoResult e)
    {
    // Crop first in here to fit the ratio
    // .....
 
    //Assign to Image Editor
        BitmapImage gambar = new BitmapImage();
        gambar.SetSource(e.ChosenPhoto);
        KanvasEditor.Source = gambar;
    }
 
    private void Button_Click_1(object sender, RoutedEventArgs e)
    {
        PhotoChooserTask task = new PhotoChooserTask();
        task.Completed += task_Completed;
        task.Show();
    }

Can you give me a clue or maybe a lend hand to give example code ? Thank You, Telerik is the best.

1 Answer, 1 is accepted

Sort by
0
I Putu Yoga
Top achievements
Rank 1
answered on 08 Nov 2013, 05:24 AM
Aha, i've found the solution

just set the PixelHeight and  PixelWidth in PhotoChooserTask, like 

PhotoChooserTask task = new PhotoChooserTask();
task.PixelHeight = 800;
task.PixelWidth = 480;


and then let the system do the rest for crop
Tags
ImageEditor
Asked by
I Putu Yoga
Top achievements
Rank 1
Answers by
I Putu Yoga
Top achievements
Rank 1
Share this question
or