Show Cropping Editor immediately

2 posts, 0 answers
  1. I Putu Yoga
    I Putu Yoga avatar
    3 posts
    Member since:
    Dec 2012

    Posted 07 Nov 2013 Link to this post

    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.
  2. I Putu Yoga
    I Putu Yoga avatar
    3 posts
    Member since:
    Dec 2012

    Posted 07 Nov 2013 Link to this post

    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
  3. DevCraft banner
Back to Top