Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cropping does not respect aspect ratio (when seting CropWidthPixels & CropHeightPixels) #4

Open
dekenless opened this issue Apr 30, 2017 · 0 comments

Comments

@dekenless
Copy link

I can run the same sample on one machine it the cropping works, insofar as if I set the CropWidthPixels & CropHeightPixels it will maintain the aspect ration. However, on other machines the crop selection, does not restrict the aspect ratio--I can resize the crop selection to anything I desire. I'm not sure if it is dependent on the version of the Photo App itself or something else. I am installing the sample App from the Store.

Here is the code I am using:

    StorageFile file = await temp.CreateFileAsync("current_image.jpg", CreationCollisionOption.ReplaceExisting);
    var token = SharedStorageAccessManager.AddFile(file);   
    var options = new LauncherOptions();
    options.TargetApplicationPackageFamilyName = "Microsoft.Windows.Photos_8wekyb3d8bbwe";          
    options.DisplayApplicationPicker = true;         
    var parameters = new ValueSet();
    parameters.Add("CropWidthPixels", (int)size.Width);
    parameters.Add("CropHeightPixels", (int)size.Height);            
    parameters.Add("ShowCamera", false);
    parameters.Add("DestinationToken", token);
    // Launches the app and wait for results
    var result = await Launcher.LaunchUriForResultsAsync(new Uri("microsoft.windows.photos.crop:"), options, parameters);

When it works: Photo App Version 16.511.8780.0
When it doesn't: Photo App Version 17.313.10010.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant