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

Add function to flip image horizontally/vertically #14

Closed
tulang3587 opened this issue Apr 4, 2018 · 7 comments
Closed

Add function to flip image horizontally/vertically #14

tulang3587 opened this issue Apr 4, 2018 · 7 comments
Labels
enhancement New feature or request

Comments

@tulang3587
Copy link

For the stickers, wouldn't an image flip functionality be good?

@burhanrashid52
Copy link
Owner

if you have enabled setPinchTextScalable(true) than you can rotate the sticker using pinch i.e rotate using two fingers

@tulang3587
Copy link
Author

Sorry, I meant flipping as in mirroring the image would be a good addition.

@burhanrashid52 burhanrashid52 added the enhancement New feature or request label Apr 4, 2018
@burhanrashid52
Copy link
Owner

Any general use case for mirroring sticker ?

@tulang3587
Copy link
Author

I think it's a pretty common function in sticker editing apps. Right now manually adding a mirrored bitmap works, but won't it be better if the functionality is available from the library itself?

Probably by adding a 'flip' button on the frame (like the old Aviary SDK):

1 cldzuyzmbypyxq8hu8xuzw

@burhanrashid52
Copy link
Owner

As of now their is no scope for this feature in the library.Hence as alternate solution you can mirror the bitmap before adding it to PhotoEditorView

This code will mirror the bitmap

BitmapDrawable flip(BitmapDrawable d)
{
    Matrix m = new Matrix();
    m.preScale(-1, 1);
    Bitmap src = d.getBitmap();
    Bitmap dst = Bitmap.createBitmap(src, 0, 0, src.getWidth(), src.getHeight(), m, false);
    dst.setDensity(DisplayMetrics.DENSITY_DEFAULT);
    return new BitmapDrawable(dst);
}

Ref: https://stackoverflow.com/questions/7925278/drawing-mirrored-bitmaps-in-android

@tulang3587
Copy link
Author

Yeah, I suppose we can use that option instead. I'll close this issue.

Thanks for this library!

@burhanrashid52
Copy link
Owner

Your welcome :)

Agfct pushed a commit to Agfct/PhotoEditor that referenced this issue Dec 12, 2018
…mage

Distinguish between sticker and image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants