I need to move the image in the canvas. The image should not follow a linear or circle or elliptical path. I know this can be achieved by using the COS and SIN functions. But here I need to get the image traversed in a 4 different path like I have shown in the below snapshot. Please help me if there is anyway to achieve this. It should be fine even If I get any idea to achieve this .
snapshot:
I'd try the android animation package first - you should be able to define a few points and get this to smooth the path between the points.
See here: http://developer.android.com/guide/topics/graphics/view-animation.html
Related
I am able to load the panorama image using PanoramaGL Library and it is working perfectly. But I am not able to add multiple hot spot even single hot spot on the top of panorama image? can any one please help me for this issue?
Have you looked into the HelloPanoramaGL example from https://code.google.com/p/panoramagl-android/wiki/UserGuide ?
in the Mainactivity on line 243 you find the following :
panorama.addHotspot(new PLHotspot(1, new PLImage(PLUtils.getBitmap(context, R.raw.hotspot), false), 0.0f, 170.0f, 0.05f, 0.05f));
the last 4 parameters define the vertical position, the horizontal position in degrees (Yaw) and the size of the Hotspot image.
Also make sure that the defined image at R.raw.hotspot exists in your raw folder
If you want to add your Hotspots with Json, there are example files for that too for every type of Panorama
hope this gets you going
How can i draw bezier curve in android , can any one suggest some references or existing source code that helps me to understand bezier curve .i want to crop image in my android app using any close path like Bezier Path. i know it is possible using rectangle but i want crop in different shape. like i make one shape using touch and want to crop that image so how it is possible. any suggestion or help. Thanks in advance.
You best bet would be to use the quadTo and cubicTo and other utility methods available in the Path class. All you have to do is determine the control points.
I have written a simple tutorial on how to use Path and PathMeasure to draw lines, curves, etc., You may find it here:
http://c05mic.wordpress.com/2012/03/23/animating-a-bitmap-using-path-and-pathmeasure-android/
Following what is explained on Android move object along a path I drawed a circle path and could animate an object along it
Now I need to move the same object along the same path but using the finger. Basically it should be like a drag and drop but using the path as a guide.
How can I do such a thing?
Thanks in advance,
U can try to get the pixel color of the touched point, then u can check if that color matches a pre-defined path color.
i had the same problem and find that very useful.
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!
I am hoping this question/issue is not too vague as I have tried asking something earlier but seemed to have came to a dead end.
Basically I am looking at stretching/pinching parts of a Bitmap within my Android project. There would be coordinates passed to the function in order to indicate where the move would need to take place (x,y).
I need to find a way to shift pixels up and down (in either a line or arc type format) and allow the pixels in between to be warped accordingly (not disappear or hide).
A sample image of what I am trying to achieve would be something like:
I would paste an image here but apparently am not allowed yet. (Image URL: http://t1.gstatic.com/images?q=tbn:ANd9GcQtLEHS-ZRQs3p7XmeU2TM6Vwgfh7DGnh-5nDIDu3Yd7zTIR0zX)
(Just grabbed a random Google face warp)
I have read about a few things like openCV and javaCV but they seem like overkill. I am simply looking for something that might allow me to move an array of coordinates from a source point to destination and allow for a smooth warp.
Any help/information is greatly appreciated.
Brad,
Heres a link on how to create a smudge tool. That should help you create images like the one you included within your post.
Hope that helps!