Android draw shapes on images and save - android

I have an application that gets image (from gallery or camera) and then I open this image in some Activity. Then I want to draw shapes on this image on tap, these shapes (once drawn) can also be dragged around over the image and removed. After drawing user can save this image with shapes so it can access them later from the application at any time.
I have managed to make image import form gallery or camera to my activity.
My question is I just want a summary of how would this need to be constructed in order to work? How would I save images with shapes and their positions so they are accessible later? I would also have an activity (I guess?) in my app which would show thumbnails of all images edited so far. I have attached some images for reference (first image is image edit screen, second image is showing thumbnails edited for far, each can be accessible for edit again).
I am a beginner so please bear in mind.

Related

Crop multiple portion from one image

I have a image from which I need create multiple smaller images by drawing rectangles on the parent image, using opencv I know how to draw a rectangle and cut it from the image using Mat and Rect, but the main problem I am facing is that the image is entered through user input and the user can choose to select any portion he/she wants to crop out, so everything needs to be dynamically operated.
The attached image will clarify things a bit
I am new to opencv with android so any help is appreciated.
also if one can provide solution without using opencv is also welcome.

How to use the library opencv on android with a newly created photo?

I would like to help me. I am new to android, want to use OpenCV to detect yellow color images in images already created by a photo, I mean, from a photo created, becomes a bitmap, and make a searching if there is yellow in the picture, and the next layout showing the image with the filter.
Unfiltered photo -> photo with filter

Highlight an background image with touch events(fingers) in android

I am new in Android and I'd like to know to highlight and image using touch event (using my finger). My approach is the next:
App use a image that is used as background, it contains text to be highlighted.
User highlight that image using his/her finger
I don't like to write directly over the image. I'm thinking in something like "Layers".
If is possible user should zoom the image because the image could be too large 5mp (the image is captured by the device camera)
I don't like to save the layer that contains the highlight because I actually need is have coordinates to have a box that will be used to extract information from the background image.
I hope someone could help me.

Merging two Images (imageOne from Drawables & imageTwo from camera)

I am developing an app which uses surface.callback to initialize the front camera when the app is started. I have done overlayering on the camera and added some buttons along with some funny images.
Now there are three ways to do this as far as my knowledge goes (and I am a newbie so if there's another method that would also be appreciable.)
Capture image: The problem is that if I capture the image from
camera, I won't get the funny images which are added on the top of
the camera preview.
Screenshot: As I have done this through overlayering, hence taking a
screenshot through code of a selected portion isn't yielding any
result also. Because it only takes the screenshot of the layer with
buttons and funny image but not the screenshot of the camera preview
as it is behind the layout containing above mentioned items.
Now the only resort is that I merge two images. One from my drawables
folder (funny images) and second obtained at runtime from front
camera.
Anyone who can kindly help me merge two images. I have seen some tutorials/codes but they take both images from drawables folder while my second image is obtained at runtime through camera.
You can capture the camera image and edit it (overlay with funny images) before writing it to file.

Does bitmap of an image remains constant throughout the lifecycle of the android application?

Okay so this might be a very silly question to ask.
Does a bitmap of an image remains constant traversing through different activities in the android.
Well my issue is :
I have an activity with image view having a default image.
I am previewing another image picked from the gallery if the user wants it.
So now then i move on to the next activity displaying the image user picked from the gallery.
Now if the user hasn't picked any image i want to show another default image.
Please note not the 1st default image in 2nd activity.
If a bitmap remains in the drawables folder, then you can access it from every Activity and it will remain "constant" so to say (if that's what you meant). If you're using the bitmap in the code (to set it as the background of the ImageView), then this can be changed - othwerise if in drawables - it's just usable, you can manipulate it, but you will never change its basic status (in the folder).

Categories

Resources