How to put other images on a photo Android - android

I take a photo in my Android app.
I want to put other images in that photo to create effects
like a ballon of conversation, a legend, and others.
After that I want to save this Image in another Bitmap.
I try put my photo as a background image, and put another ImageViews components under that and try to take a printScreen of my screen. But I think it isn't the best way to do what I Want.
Can anybody help me?
Sorry for my english

I think the best bet would be create a Canvas based on your photo (you'll need it as a mutable Bitmap) and then use the drawBitmap() to draw another bitmap onto yours (you'll have to pass it the offset and Xfer mode).
The original mutable bitmap will now contain the combination of of your images

You can try FrameLayout.
Just put the photo in the background, and then put ballon of conversation in front of photo.
If you want to combine photo and ballon effect, you could use Bitmap.
Just record the effect's coordinate.

Related

How to take an image from gallery

I need to pick an image from the gallery of the phone in order to do some stuff with that.
For this purpose I tried to follow what is inside this android pick images from gallery thread but I think it's too old, probably I need to use the intent anyway but I don't understand how and how to pass the image picked to a bitmap variable.
Precisely I need to take an image and then convert it to bitmap and do other stuff (ml algorithms).
Thanks.

How to crop an image taking base a rectangle in android?

I'm implementing a custom camera, in the layout I have a rectangle inside the layout, where the user have to put his card, so after take the photo i need crop the picture, taking the reference the rectangle.
Any suggestion of how to do this?
Possibly you can use a library that do this on your behalf.
If you are not fully satisfied and need to understand how it works the process you can read the API. I do not know exact if you mean the selection have to be a rectangle of you are referring to the rectangle of your customer view where the card should fit, in the first case the library from Arthurhub should be enough
if you want to implement from scratch, I guess you need to use Matrix
enter link description here
https://github.com/ArthurHub/Android-Image-Cropper

Display image after image, as in layers to create a single image

Hi I am making a hangman, and I need to show image after image each time the player fails an attempt eg head first, then the body ect. I'm doing a layerdrawable but not how to scale it to the original image, how climb as I show the image and the images layer by layer to create the hangman?
I'd think the simplest way would be to decide what size your image is going to be. Then just use several PNG images with one body-part drawn on them and a clear background. As long as the images are all exactly over one another, you should see the familiar image of a stick figure drawn one part at a time.
Hope this helps.

Drawing on Canvas with an image on background and save image

I want to open an image from SD card, while image is on display I want to draw on it using touch and motion events and save the image back. Any help or pointer to any sample code would be of great help.
I'm sure there are many ways, and many ways better than this but this is how I would do it:
Basically in my understanding you need to open the image from an SD card to a bitmap to a imageview in your activity. http://www.higherpass.com/Android/Tutorials/Working-With-Images-In-Android/2/
Then you need to go pixel by pixel and get each value for the color so you can change it in an onTouchEvent. http://developer.android.com/reference/android/graphics/Bitmap.html See getPixel() and setPixel()
The user gets to draw stuff on it. You need some way to capture the motion event, and change your data model of the image you just got by getting all of the pixels. You could use a surfaceview or something similar. Android: creating a Bitmap with SurfaceView content
Finally you need to save the picture to the SD card. Android write to sd card folder
Hopefully this helped

Can we edit the picture in Android to set the Radius of the pics on the edges?

I would like to know if we can edit the picture that we take from a camera and store it on our Phone. Can we make use of android.graphics package to edit the picture.
One of the sample picture has has been edited on the top width is this as you can see the image has been clipped from the top center just below the word "Discovery". Is this possible on Andriod?
Yes, you can make a Canvas out of a bitmap, and then use canvas drawing commands to mutate and save it again.
I'm not really sure what you're asking, though.

Categories

Resources