how to change a position of a bitmap on canvas

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

how to change a position of a bitmap on canvas

Postby ama10285 » Fri Apr 01, 2011 2:32 pm

Hi all^^
I try to show a position on a map (in the position(100,100) of the map). This work fine with this code:

options = new BitmapFactory.Options();
options.inTempStorage = new byte[16*1024];
Bitmap bitmapImage = BitmapFactory.decodeResource(getResources(),R.drawable.dasa_map,options);
Bitmap myMap=bitmapImage.copy(Bitmap.Config.ARGB_8888, true);
Bitmap positionIcon=BitmapFactory.decodeResource(getResources(),R.drawable.ic_maps
_indicator_current_position);
Canvas c = new Canvas(myMap);
Paint paint= new Paint();
c.drawBitmap(b, 100, 100, paint);

Now i want to change the position of my "positionIcon" on the Map"myMap"( for example to (200,200)), how can i do this?
Pls help me
Thanks in advance
ama10285
Freshman
Freshman
 
Posts: 2
Joined: Fri Apr 01, 2011 2:23 pm

Top

Re: how to change a position of a bitmap on canvas

Postby strider2023 » Mon Apr 04, 2011 6:54 am

Use a thread to update the drawing position of the bitmap on the cavas.
strider2023
Senior Developer
Senior Developer
 
Posts: 126
Joined: Tue Mar 02, 2010 6:34 am
Location: Chennai, India

Re: how to change a position of a bitmap on canvas

Postby ama10285 » Mon Apr 04, 2011 8:22 pm

Ty for the answer^^
yes but how will you update the position ? The Problem is taht i don t know how to remove the "positionIcon" from the old position. Could you more explain pls?
thx in advance
ama10285
Freshman
Freshman
 
Posts: 2
Joined: Fri Apr 01, 2011 2:23 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Exabot [Bot] and 23 guests