Draw on an image - android

Here is my problem. I am currently working on an android application that is handling images. When the application first starts, I have a list of categories (Food, Transport, Emergency ...). So I click on a category for example Food. I find myself in the second activity where I have subcategories (Fruit, Meat, Fish ...). So let's say I click on Fruit. I end up in the third activity which displays images (like in a gridview) of different fruits. I can either click on a fruit to zoom it or I can drag & drop it to the bottom of the activity where I have 3 dropzone that are here for me to create a sequence of images and save it.
So back to my problem, when I zoom on an image I want to be able to add a drawing feature. I want to be able to draw on the image when I click on the menu button of the phone and when I select "Draw". I tried to draw on an image but the drawing lines are always going underneath the pictures so I can't see them. Besides, I want to be able to save the image afterwards and I can't seem to find a way to my problem.
Could someone help me please?
I tried using BitmapFactory but it got me nowhere...
Thank you

Try to use search:
How to draw text On image?
How to draw a Line in ImageView on Android?
https://stackoverflow.com/search?q=android+Draw+on+an+image

Related

Drag one image at a time to the top of another image

I have 4 images at the bottom of my screen (but in the future I can have more) and 1 image at the top.
I would like to click on the bottom images one at a time and drag to the top image and at the end save the image from above with all the images.
Note: The user can drag one, two or no image so it depends on it.
I have an example below:
enter image description here
Any tips on how I can do this?
Any API?
Or a Framework?
Any examples in git?
You can download this example and change it to meet your requirement.
I just tested and it works perfectly on Android emulator.
Here is a gif:
Refer: xamarin-imageview-drag-sample

Android : Imageview with fixed position on next activity

I am developing application where user capture's photo and moves to next activity with captured image. Now in next activity i have already given another image via XML which i am able to move and set anywhere over captured image now what i want is when i press OK button then this activity should move to next activity with captured image and also other image which i have set.
i have done with this but the problem is, i want to Fix the position of other image, example if i have set that image on captured images Nose then it should show on nose for Next activity. I don't have any idea about this. Can anyone tell me how to fix the absolute position of Image or any sample code that might help me.
Here you can see the photo, When i press OK button next activity looks something like this. http://share.pho.to/3wDYP
Basically you need to merge these two images into one. Create a bitmap and add both images into one.
Here is an example answer1 and answer2.
Also This is a very useful Tutorial 1 and Tutorial 2 for you.

Image Circulation in android

I have created a app to find the hotels, I am using a slider to show all images related to the hotel's. But I want to get the first image after the last slide in circular fashion.
Get idea through below Picture, Because I want to achieve it in same way.
Sliding SlidingSlidingSliding
All image must be in circular fashion with no end point for image in gallery while sliding.
Please have a look at the below library called InfiniteScrollView.
I think this will do exactly what you are looking for.
https://github.com/satansly/InfiniteScrollView

Android, How to show array of address of images with intent?

I have an array which includes URL address of for example 20 images. When user clicks on a button i need to show image in full screen mode and if user touched the screen and his finger points to right or left then show next or previous image (something like loading image from gallery and navigating to right or left).
Is it possible to do it with intents? Thank you.
Yes you can do it, find out the Gallery example in Android Universal Image loader.

Selecting thumbnail and viewing full screen

I have my app working where it comes to a screen with 6 thumbnails. The user will select one and the next screen is a full image. I've accomplished this through an OnClickListener to call a new activity/xml (I'm new at this, sorry if my terminology is a little off).
My question is: is there a way to avoid creating 6 activty/xml (one for each thumbnail)? ultimately, my app will have about 40 thumbnails that can be selected for full screen view.
I've been trying to follow examples online where it appears that the code is presenting the full image within java instead of referencing an xml file. I've also seen use of Bitmap and BitmapFactory. Is this the way to go?
If the full screen image can be created dynamically within java, will the Back button still work to the user back to the screen with 6 thumbnails?
thanks, J
The simplest approach to take is to pass a reference to the image in the intent you use to launch the full-screen activity.
You can use the BitmapFactory to create a Bitmap, and then update the ImageView (or however you're displaying the image) from the loaded bitmap.
Using this approach, the back button will still work normally, but you'll only need one activity to display the full-screen image.

Categories

Resources