Drawing Image on Android - 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.

Related

Android: draw figures on canvas

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.

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

How to create isometric grid android

i want to draw i grid like
Link
can some one please help me to create this grid programmatically in android
i am new to android game development and this is required for project
requirement is to create grid of tiles
Thanks in advance
You might need to draw this you self. If seems doable. But if you dont know how drawing is done, these tutorial should help.
Just use a combination of drawRect and drawLine to get this drawn.

Can somebody suggest me svg library for 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.

OpenGL problem on Android

I'm quite new to animations in Android. For 3D animations I have to use OpenGL to make it look more fluid.
Is it possible to convert a Drawable that is i draw some rectangle or circle on a canvas and i want that to convert into a View using OpenGL. Is that possible and if so then how?
Can anyone please let me know what does the first point in the FEATURES say in this URL http://developer.android.com/reference/android/opengl/GLSurfaceView.html
Well, you can try to convert a Drawable to a bitmap and then map this bitmap on a 3D surface in OpenGL as a texture.
OpenGL doesn't operate on that level. OpenGL is just a drawing API, giving you "pens and brushes" to draw on some canvas provided by the operating system. Any OS specific concepts like Drawables and Views are out of the scope of OpenGL and won't be dealt with by it.
However maybe if you described in detail what it is you want to achieve we may be able to help.

Categories

Resources