OK, I think I understand whats going on - an ImageView displays the
image by:    view.setBackground(imageyouwanttosee);

this is not want I would want or expect, for precisely the reason that
my clipping does not affect it.  its lazy in my opinion.  If I want to
display a view with an image as a background, then I will call
setbackground ON ANY TYPE OF VIEW.  thats not what ImageView
specifically should do in my opinion - it should set the image in the
foreground so that view operations can be done on it.

Im calling 'bug' on this.

On May 8, 5:45 pm, stefoid <[EMAIL PROTECTED]> wrote:
> Example code below is my attempt to clip an ImageView  with a non-
> rectangular shape.  It doesnt work, I see the full rectangle.
> Obviously I am misunderstanding some basic thing about the way android
> graphics works.
>
> any help appreciated.
>
> also another question - why dont I have to call super.onDraw in my
> override function?
>
> public class ClipView extends ImageView{
>
>         public ClipView(Context context) {
>                 super(context);
>         }
>
>         //@Override
>          protected void onDraw(Canvas canvas)
>         {
>                 Path path = new Path();
>                 path.rLineTo(300,0);  // across 300
>                 path.rLineTo(0,200); // down 300
>                 path.rLineTo(-300,150);         // left and down diagonally
>                 path.close();                           // go back to start 
> pos
>
>                 canvas.clipPath(path, Op.REPLACE);
>         }
>
> }
--~--~---------~--~----~------------~-------~--~----~
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]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to