I am working on android 2D graphics. My requirement is simple. I have to Zoom and panning around the image and i need to draw on particular palce(free hand drawing).
hello see this its exactly as per your requirement..:):) good luck
Related
I need to draw an image on android, but I want to draw it row by row how can I do that with good performance.
Also, if I need to draw a random region in an image how could i get it in android....
I'm totally new to the android programming.
This is all explained in the Canvas and Drawables developer guide.
Basically the Canvas API "provides a set of 2D-drawing APIs that allow you to render your own custom graphics onto a canvas".
https://developer.android.com/guide/topics/graphics/2d-graphics.html
http://androidcodesnippetsblog.blogspot.in/2013/01/drawing-image-using-canvas-in-android.html
try this this will help you.
I m working on canvas. Here I just want to draw some geometric figures on canvas which may be resized according to the touch_move positions. By figures , I just meant triangle,rectangle,circle and some polygons. Is there a way to achieve this? . I haven't seen such apps which can draw these figures over canvas. So this seems to be complicated.. Thanks in advance
See this link.
If your application does not require a significant amount of processing or frame-rate speed (perhaps for a chess game, a snake game, or another slowly-animated application), then you should consider creating a custom View component and drawing with a Canvas in View.onDraw(). The most convenient aspect of doing so is that the Android framework will provide you with a pre-defined Canvas to which you will place your drawing calls.
I'm sure you can find some open-sourced out-of-the-box solutions for this if you tried a little.
If you actually want to learn something you should read the tutorials of per example;
-Custom Views
-OpenGL
After doing the tutorials, you'll have 2 ways to draw basic shapes, a triangle and a circle I believe, already done.
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/
Can somebody suggest me svg library for android? I have a list of objects with coordinates and I need to draw them like circles on a svg picture and on click a new activity shall be opened. It is importanrt that I can implement zoom in/out on that map.
You can extend a view and override the onDraw method which gives you the canvas.
Using the canvas you can draw circles.
One svg library that works on mobile devices is d3.
It can do everything you described. (Take a look at this code example with zoomable circles).
Here you can find a video tutorial that explains how to use d3 for mobile devices.
i have been trying to make such a demo where i need to draw many(hundreds of) circle shapes on canvas(or any other way if possible) ,
after drawing the canvas i need to zoom and move it..
and also want to capture the click(touch) event of each shape separately ..
so i know i can get canvas touch event and get x and y positions and check which which circle is touched but i have to draw many circles and as well after zooming and moving the circle's x and y pos is changes so plz help me..
Give me any suggestion how to do this..the way to go..
or if any ANDROID MASTER have done some thing like this..plz plz give me code sample..
thank you all,
good day..
according your requirement you have 2 use one of the android game framework you can find so many game engine check this thread or you can use andengine one of the best 2D game engine in that you can find many example code.
for your requirement just follow the PinchZoomExample from here
any further help comment the question i love to help this prob.