Android Question How to cut an image with my fingers?

Matteo Granatiero

Active Member
Licensed User
I need to cut out an image with my fingers, and that the hatching appears and obviously the cut part will be darkened to make it clear that it will be cut out. Then with a button confirm the whole and the part cut out (darkened) will become transparent
 

Peter Simpson

Expert
Licensed User
Longtime User
You want to print the cut image, sorry I'm a bit lost in translation.

I would cut the image, save the image, then I would print the saved cut image. There's plenty of source code on the forum on how to print images, you can just adapt the code to suite your needs.
 
Upvote 0

Matteo Granatiero

Active Member
Licensed User
You want to print the cut image, sorry I'm a bit lost in translation.

I would cut the image, save the image, then I would print the saved cut image. There's plenty of source code on the forum on how to print images, you can just adapt the code to suite your needs.
I would like to cut out the original image of the fingers *, then drawing and saving what I have cut out in a certain path. The link you sent me invick has me use a control panel for cropping to my would just hand drawing
 

Attachments

  • .jpg
    .jpg
    170.1 KB · Views: 293
Upvote 0

Peter Simpson

Expert
Licensed User
Longtime User
I've got you now, I thought that but then I changed my mind.

There may or may not be a library on here that can do that for you, you'll have to search for one just incase one is in here.

Sorry I can't point you to a library, maybe somebody else knows of one.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Is this, what you are looking for?

upload_2017-12-23_16-19-29.png
upload_2017-12-23_16-20-36.png


I updated the project to a new version, CropImageFreeHand, which saves the croped image with the original image size.
The previous project saved the image with the panel size.
 

Attachments

  • CropImageFreeHand.zip
    67.1 KB · Views: 388
Last edited:
Upvote 0

Matteo Granatiero

Active Member
Licensed User
I updated the project in post #9 to a new version which saves the croped image with the original image size.
The previous project saved the image with the panel size.
I have a little problem, every time I take a picture the panel that supports cropping resizes you know how can I solve?
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
The program flow:
- The width and height of the Panel are adapted to the aspect ratio of the bitmap.
- Draw with the finger the border for cropping.
- Press Crop, the image is cropped, the entire surface of the Panel is set to transparent and the bitmap is drawn again onto the Panel with the crop path.
- Press Save, the bitmap of the Panel Canvas is saved, the Panel dimensions are reduced to the outer dimensions of the cropped image, the cropped image is drawn onto the Panel. This you can see when the cropped image moves toward the upper left corner. The new Canvas image is saved. I did it that way to see what happens.
- Press Clear, to get the original Panel.

I don't understand exactly your question, but I suppose you are missing the last point in the program flow above.
 
Upvote 0

Matteo Granatiero

Active Member
Licensed User
The program flow:
- The width and height of the Panel are adapted to the aspect ratio of the bitmap.
- Draw with the finger the border for cropping.
- Press Crop, the image is cropped, the entire surface of the Panel is set to transparent and the bitmap is drawn again onto the Panel with the crop path.
- Press Save, the bitmap of the Panel Canvas is saved, the Panel dimensions are reduced to the outer dimensions of the cropped image, the cropped image is drawn onto the Panel. This you can see when the cropped image moves toward the upper left corner. The new Canvas image is saved. I did it that way to see what happens.
- Press Clear, to get the original Panel.

I don't understand exactly your question, but I suppose you are missing the last point in the program flow above.
how do I remove the panel at the height and width of the photo? maybe this is the problem
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Sorry, I don't understand what you want to do?
What do you mean with remove the panel at the height and width of the photo?
You need to be more precise in your questions.
Do you want to remove the Panel?
If yes, you can remove it with pnlImage.RemoveView.
 
Upvote 0

Matteo Granatiero

Active Member
Licensed User
Sorry, I don't understand what you want to do?
What do you mean with remove the panel at the height and width of the photo?
You need to be more precise in your questions.
Do you want to remove the Panel?
If yes, you can remove it with pnlImage.RemoveView.
I want to remove this function : - The width and height of the Panel are adapted to the aspect ratio of the bitmap.
 
Upvote 0
Top