Firstly I'm using Android application to rotating image with selected angle. that image has drawable lines by canvas.
I'm able to rotate the image but the line not.
I want to rotate and draw lines with new directions.
Related
As you can see in the picture, a drawing has been made on a transparent canvas, I want to scan the line on the canvas I want to make in pixels and find out its location and size, how can I do this?
Click to see the picture
Using an example found here:
http://www.vogella.com/tutorials/AndroidTouch/article.html I'm able to draw a path every time a finger touches the screen and that works great, Is there any way that I can capture that drawn path and reproduce it in another view in other coordinates? Like capturing the full drawn image and reproducing it scaled in a segment of the other view?
Sorry for my bad english
You can save your drawn image and save it as a bitmap. Then you can scale it with Matrix or Canvas and redraw it by calling to where you want to draw
How can I determine in which direction and how far I have to rotate the image? I use Android Canvas to draw the line and the arrow image.
canvas.drawBitmap(arrow_direction, leftpos,rightpos,null);
The image is always shown as it is. The image shows clearly that I have to rotate it 90 degree to the left.
I know I can rotate the image with
Matrix rotator = new Matrix();
rotator.reset();
rotator.postRotate(degree);
But I don't know how to calculate the value for degree to rotate the arrow? I know only the coordinates of the two red points. So I think it might be possible to calculate it with this two points, but I don't know how.
In another way how can determine on which side of the image is the end point of the line? In the example it is on the right side, therefore I know that I have to rotate the image -90 degree.
I have a circle image(image1) and i am getting one more circle image(image2) dynamically. Now i want to fit the image2 in the image1. is it possible?if yes, How can we implement it.
Image1
You should be able to draw it within the bounds of the canvas of your image. Specifically you can grab the width/height of the second image and then change the drawing positioning of your bitmap by drawing it manually on a canvas and then controlling the X/Y offsetting during the drawing procedure.
Something like this
This is if your source image is at a fixed resolution (ideal). The concept would be to build the image using the Canvas object and then superimpose the other image on top of it. And build a bitmap from that.
Fellow Programmers,
I am new to android and I am trying to draw on a image based on giving the x and y axis of the image as the input.So that he pixel value corresponding to the coordinate gets filled with a color that I mention. Say Red color for now.
User Story: Render a image through image view and on a button click I need to pass the co-ordinate value for the image that represents the pixel of the image and fill it with red color. Keep on doing it looks like drawing on the image that I render using image view.
Is this user story is possible to do in Android? If then help me on this. I referred the draw class and canvas class and not sure how to implement.
Looking forward to ur help on developing this user story on android application.
Best,
Googler
Take a blank canvas.
Draw your image on the canvas.
Draw points on the canvas by specifying x and y co-ordinates and red color in paint.