Forum Xamarin.Android

Announcement:

The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Change properties when cropping the image

monemdcmonemdc Member ✭✭✭
edited November 2020 in Xamarin.Android

I want a way to continuously display the custom arrow to expand the size of the square into a piece. I also want to change the orange color for the border
code crop
`
private void CropImage()
{
try
{
CropIntent = new Intent("com.android.camera.action.CROP");
CropIntent.SetDataAndType(uri, "image/*");

            CropIntent.PutExtra("crop", "true");
            CropIntent.PutExtra("outputX", 100);
            CropIntent.PutExtra("outputY", 150);
            CropIntent.PutExtra("aspectX", 0.5);
            CropIntent.PutExtra("aspectY", 4);
            CropIntent.PutExtra("scaleUpIfNeeded", false);
            CropIntent.PutExtra("return-data", true);

            StartActivityForResult(CropIntent, 1);
        }
        catch 
        {

        }
    }

`

Tagged:

Best Answer

Answers

  • ColeXColeX Member, Xamarin Team Xamurai

    com.android.camera.action.CROP does not provide such function .
    You could use this plugin , it supports more Customizations .

  • monemdcmonemdc Member ✭✭✭
    edited November 2020

    hi
    ColeX

    First of all, I would like to thank you for your help.
    I have a problem The project that you referred to in github, I transferred the project content again and downloaded all the libraries with the new project, and I had an error in this part

    full project after edit

    https://drive.google.com/file/d/1tUSTyiq5qUPpaY6z2Jd1m2tv_HRE-QuL/view?usp=sharing

  • ColeXColeX Member, Xamarin Team Xamurai

    @monemdc said:
    hi
    ColeX

    First of all, I would like to thank you for your help.
    I have a problem The project that you referred to in github, I transferred the project content again and downloaded all the libraries with the new project, and I had an error in this part

    full project after edit

    https://drive.google.com/file/d/1tUSTyiq5qUPpaY6z2Jd1m2tv_HRE-QuL/view?usp=sharing

    Remove the two lines about SupportActionBar.

    BTW You link needs permission that i can't get access to it .

  • monemdcmonemdc Member ✭✭✭

    hi ColeX

    But when you hide 2 lane
    The command to save the modification does not appear after cutting with a tool. Is there a code to display the change and save?

  • ColeXColeX Member, Xamarin Team Xamurai

    Can you enable the permission so that i can access your project to test ?

  • monemdcmonemdc Member ✭✭✭

    hi
    colex

    Sorry, I did not observe the download permissions

    https://drive.google.com/file/d/1tUSTyiq5qUPpaY6z2Jd1m2tv_HRE-QuL/view?usp=sharing

  • ColeXColeX Member, Xamarin Team Xamurai
    edited November 2020

    Change the theme from NoActionBar to DarkActionBar in style.xml , then we can get SupportActionBar in Activity.

     <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    

  • monemdcmonemdc Member ✭✭✭
    edited November 2020

    hi
    colex . You have cooperated a lot with me.
    I lack this part:
    Yes, the example is complete now, but how is the image saved after the cropping process?
    Another question, how to delete the blank background of the part that has been cut?

Sign In or Register to comment.