single touch movement and scaling image in android - android

I am developing one application with drawing and all, One problem I am facing is I want single touch scaling image. I have done image scaling with multi touch but I am so stuck with single touch.
Example :-
I have one Rectangle on canvas. Now I want to scale and rotate that Rectangle with its one corner with one finger. I am finding this on google but not get perfect materiel or demo and else.
Please help me to find this.

For zooming with single touch this will help you
http://developer.sonymobile.com/wp/2010/05/18/android-one-finger-zoom-tutorial-part-1/

Related

Detect shapes and create histograms

I am working on an app that will compare histograms in hopes to match faces.
The app allows the user to take a photo, select a few key points in the image and then the app draws circles around those points. I then detect the circles using the OpenCV Hough Circle Transform functions. Up to this point the app works great.
What I need to implement now is one of two options:
Detect the circles and create separate histograms for the area inside of each circle.
Detect the circles and blackout the area(s) around the circles and create one histogram.
I'm leaning towards method 2, but I'm not sure how mask/color/paint around the area outside of the circles after they are detected. Any input would be appreciated. Thanks.
Instead of painting the area outside the circles in the original image, why not create a new image and copy the content of the circles to it?
Another point is that histograms are independent of translation. So, it does not matter if you copy the circles to the exact locations in the new image.
Do clarify if I did not answer your question, or if you have other questions now.

I need coordinates of angles some rectangle area (like crop rectangle) on image/photo. How i can get them?

I need some activity with image cropping, but without getting crop image, just need coordinates angles of rectangle area on image which i can move and resize. How i can make this or where i can find such library with this functional? Sorry for my bad English.
For your purpose you better to use Android Canvas. When you touch a particular point you can get details of that point using 'OnTouch'(http://developer.android.com/reference/android/view/View.OnTouchListener.html) method in android.

Moving image in circle with touch move

I want to move an image within a circle with my touch on move. I've been confused how to determine the coordinates circle boundaries when the finger moved.
For example I want to move this image like lock screen on android tabs.
http://cdn.alltouchtablet.com/wp-content/uploads/2012/03/samsung-galaxy-tab-7-plus-lock-screen.jpg
EDIT :
Now After learn the answer below, I managed to draw an circle image and moving this image around the screen.
And now, I want to restrict the image movement so that it only can moved in a circle, just like in the image above. Any ideas?
I hope you can help me. Thank you!
so I've actually not done anything like this but i know this tutorial : and the guy does something similar to what you want,
this video is one right in the middle of an entire playlist of tutorial videos if you dont get what he's doing check the previous few... as for moving the image in a circle i'm sure there'll be some way to set boundries :)
http://www.youtube.com/watch?v=9d4Wua-cxZs&list=PLB03EA9545DD188C3&index=32&feature=plpp_video
hope it was helpful!

Is it possible to get the points of bitmap as path?

suppose my bitmap is like
This image is actually in square transparent. I want to get the only viewable points as array so I can bound it and handle touch event on canvas. Right now it is square so when I touch at the corner of the image it still detect touch event on image. i don't want to do like this. Only if user clicked on viewable part then only action would be taken otherwise not.
For temporary I have used radius of image from center point it works fine but accurate, also if this image triangle part length is long then if it remain in square format user fill/get event on image outside.
I have used canvas to draw bitmap. Is there any other way or easy way to do this thing and handle event.
I have seen many games in that they used like custom shapes and touch event fire only on display part of object, how could i achieve this things.
Take a look at coordinates:
Android Canvas Coordinate System
and
http://code.google.com/p/apps-for-android/source/browse/trunk/SpriteMethodTest/src/com/android/spritemethodtest/CanvasSprite.java?r=150
Which goes into sprite:
http://p-xr.com/android-tutorial-how-to-paint-animate-loop-and-remove-a-sprite/
This may help too:
http://www.droidnova.com/playing-with-graphics-in-android-part-vi,209.html
Some of that should be helpful.

Comparing gestures/images in Android

What would be the best way to compare a gesture made on an Android device's screen with a stored gesture? For example, if in my application, I want it so that if I draw a triangle with my finger, the screen will turn blue, and if I draw a circle, the screen will turn red, how could that be done? The only thing I have been able to think of so far is to somehow generate an image file and then compare that to an image of a triangle or circle and check for similarities. But that wouldn't really account for different sized shapes or offset ones. Any ideas on how this could be implemented? Thanks!
There is no need to compare/match the shape of a gesture with an image. The better way is to mathematically guess which one of the recognized shapes did the user draw. http://developer.android.com/resources/articles/gestures.html provides a great reference for implementing gestures.
HTH,
Akshay

Categories

Resources