Method like copyRect (Delphi) in Android 2d Graphics ?

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

Method like copyRect (Delphi) in Android 2d Graphics ?

Postby sasuke » Sat Mar 01, 2008 12:05 pm

Hi all,

Is there any method (It's like copyRect in Borland Delphi) in android 2d graphics that provide us with stuff like this:
I had an image (640 x 640). I just want to draw a certain area of the image on the emulator screen, like a rectangle from 0,0 to 200,200 (the pixel from 200,200 to 640,640 won't be drawn, so it's much faster and much efficient).

There's some method called clipRect in Canvas class. But it's returning a boolean.... :roll:

Regards,
sasuke
sasuke
Experienced Developer
Experienced Developer
 
Posts: 57
Joined: Fri Nov 30, 2007 1:25 pm

Top

Postby plusminus » Sat Mar 01, 2008 2:29 pm

Hello sasuke,

you can use invalidate(); to redraw the whole screen or use public void invalidate(Rect dirty); to invalidate just a short piece of a View.

I'm not sure if this is exactly what you were looking for...

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby sasuke » Sat Mar 01, 2008 2:45 pm

Hello plusminus,

hmm.. i don't think that's what i look for.. it's not the screen, it's the image. I got 640 x 640 pixel image, that i want to be drawn on the 320 x 480 pixel screen, i am making a scrollable map. e.g,right now the image's region that i draw is 0,0 to 100,100. When i pressed RIGHT, the image's region become 10,0 to 110,100. so, everytime i just draw a 100 x 100 pixel from the 640 x 640 pixel image.

regards,
sasuke
sasuke
Experienced Developer
Experienced Developer
 
Posts: 57
Joined: Fri Nov 30, 2007 1:25 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot] and 19 guests