Skip to content Skip to sidebar Skip to footer

Android Place Imageview On Top Of Canvas

how can I display a programmatically created ImageView on top of a previously created View Canvas? I tried using bringToFront(), but without success. Code: RelativeLayout root = fi

Solution 1:

You have to redraw your imageview on canvas:

  pcanvas = new Canvas();
        pcanvas.setBitmap(bitmap);    // drawXY will result on that Bitmap
        pcanvas.drawBitmap(bitmap, 0, 0, null); 
        mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC));
        image.draw(pcanvas);

        img.bringToFront();
        img.invalidate();
        img.draw(pcanvas);

Post a Comment for "Android Place Imageview On Top Of Canvas"