get cordinates from txt file and show on image

Put your problem here if it does not fit any of the other categories.

get cordinates from txt file and show on image

Postby androidgps » Mon Sep 12, 2011 5:22 pm

Hello guys....! :)
i have a problem.....i don't know how can i read a txt file from SDcard and show the information to image...?
For example, I have a txt file with differents coordinates [(100,100), (150,80), (30,65)] and show these points on image....
Thanks in advance!!
Posts: 7
Joined: Sun Jul 31, 2011 4:12 pm


Re: get cordinates from txt file and show on image

Postby phishman3579 » Tue Sep 20, 2011 3:09 am

I assume that those numbers or pixel coordinates? If they are lat/lon values than that's a different question (which i can answer, if needed). You will likely have to create a View that extends the ImageView class and then over-ride the onDraw(Canvas canvas) method which will draw both the image and the points.

Look into the canvas.drawRect() and canvas.drawBitmap() methods.

I have some code that draws lines, rectangles, and bitmaps on a canvas in my augmented reality framework. You can find it here: ... -framework

Look at com/jwetherell/augmented_reality/activity/ for hints on over-riding the onDraw() method.

Also look at the classes in com/jwetherell/augmented_reality/ui/objects/ to see some examples of drawing on the canvas.
Posts: 9
Joined: Sun Aug 28, 2011 4:49 pm


Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 5 guests