views:

501

answers:

2

I'm having quite a problem here and I hope for someone here to able to help me. let's go.

Let's say, I have quite a big image ( 1500x2000 ), i load it as a drawable, fine so far. Now I have a SurfaceView and I want to draw a certain region ( lets say the top-left-most region ) onto a canvas, in a non-scaled version. I thought using ClipDrawable would be just the right thing to use, but actually, I can't get it to do what I want to. It just displays a scaled-down image with the clip applied.

So basically my question is: how to draw a non-scaled drawable onto a surface, and how to clip that drawable?

any help appreciated, thank you :-)

A: 

Alright, I'm no using the Modelview transformations provided by the Canvas object. Works fine.

moritz
+1  A: 

To clip a drawable simply set the appropriate clip region on the Canvas prior to drawing the drawable. Don't forget to save()/restore() the Canvas!

Romain Guy
thats the way i'm going now. took some time to figure it out, well now it works. thank you.
moritz