I'm trying to understand how to use the canvas and am going through
the example provided in the ApiDemos.

I'm very confused by this section of code:

                   1         canvas.save(Canvas.MATRIX_SAVE_FLAG);
                   2         canvas.translate(x, w*0.5f + 4.0f);
                   3         canvas.save(Canvas.MATRIX_SAVE_FLAG);
                   4         paint.setColor(outer);
                   5         canvas.scale(w, w);
                   6         canvas.drawOval(mRect, paint);
                   7         canvas.restore();
                   8         canvas.scale(w-5, w-5);
                   9         paint.setColor(inner);
                   10      canvas.rotate(-values[i]);
                   11      canvas.drawPath(path, paint);
                   12        canvas.restore();


>From my understanding of what save() and restore() does... it would
appear that lines 4,5,6,8,9,10,11 would do nothing affect the final
view.

Can someone explain this to me?

Thanks,
Mercy

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to