Can somebody suggest me svg library for android? - android

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.

Related

Drawing Image on Android

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 want to crop image using Bezier curve in android

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/

Create draggable edge point on imageView

I want to create a resize feature of my application but I cannot find a sample implementation of it. Many tutorials offers pinch to zoom.
My problem now is how to implement draggable edges to resize the image just like in ordinary image editor. Do you have any idea how to do this? Just like putting circles/points on the 4 corners of the ImageView like the sample image below.
Is it possible to use the crop library of android to have draggable image?
You can draw the control point, and handle all festure in this point
last month i develop a Android handwritting note app. In this app, i inherit View, and control View.onDraw directly. I draw the image and all control indicator in onDraw, and handle screen touch within the scope of the screen.
This app isn't accomplished, it become a opensource project, you can see the source at https://bitbucket.org/gd920129/white-board/

How to implement a zoom in method in a View?

I Have created a guidance application which consist a map. This map is drawn dynamically using the data from the database.[rectangle coordinates] To draw the map i have used a View class and overriden the Ondraw method.
The problem is that i cant find a way to implement the zoom in functionality. I have already used Gesture Detector class to handle OnLongPress and the OnTouchEvent methods. I was thinking of the Pinch-to-Zoom-in functionality but have no idea of how to do it.
Looking forward for some great ideas. Thank you!
Classes extends
View
GesturDetector
Can you give us some more information about how you are drawing this dynamic map? For now, I'll make an assumption and run with it. If you are drawing shapes on a canvas you can point the canvas at a Bitmap to draw onto:
Bitmap myDynamicMapBitmap = new Bitmap(MAP_WIDTH, MAP_HEIGHT, Bitmap.Config.ARGB_8888);
mapCanvas.setBitmap(myDynamicMapBitmap);
// Draw your map on the canvas here
Now that you have a bitmap representation of your map, you could utilize this open source project, which is basically an adaptation of the built in Android photo gallery app that allows users to pan and zoom images:
ImageViewZoom on GitHub
I've used that project before for an app, and it works really well. You may need to tweak it some to get your desired behavior (for example disabling panning, since you didn't say you wanted that).
Then all you have really have to do is:
imageViewZoomInstance.setImageBitmap(myDynamicMapBitmap);
That view includes built-in pinch zooming. You'll probably want to merge it with your current View that you've created.

android Zooming and paning image with canvas drawing

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

Categories

Resources