Punch a hole in a rectangle overlay with HW acceleration enabled on View

Instead of allocating a new canvas on each repaint, you should be able to allocate it once and then reuse the canvas on each repaint. on init and on resize: Bitmap b = Bitmap.createBitmap(getWidth(), getHeight(), Bitmap.Config.ARGB_8888); Canvas c = new Canvas(b); on repaint: b.eraseColor(Color.TRANSPARENT); // needed if backColor is not opaque; thanks @JosephEarl c.drawColor(backColor); c.drawCircle(cx, … Read more

Masking(crop) image in frame

Finally got the solution while changing mask image and using of Xfermode with Bitmap Mask ImageView mImageView= (ImageView)findViewById(R.id.imageview_id); Bitmap original = BitmapFactory.decodeResource(getResources(),R.drawable.content_image); Bitmap mask = BitmapFactory.decodeResource(getResources(),R.drawable.mask); Bitmap result = Bitmap.createBitmap(mask.getWidth(), mask.getHeight(), Config.ARGB_8888); Canvas mCanvas = new Canvas(result); Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_IN)); mCanvas.drawBitmap(original, 0, 0, null); mCanvas.drawBitmap(mask, 0, 0, paint); paint.setXfermode(null); mImageView.setImageBitmap(result); mImageView.setScaleType(ScaleType.CENTER); … Read more

What does PorterDuff.Mode mean in android graphics.What does it do?

Here’s an excellent article with illustrations by a Google engineer: http://ssp.impulsetrain.com/porterduff.html PorterDuff is described as a way of combining images as if they were “irregular shaped pieces of cardboard” overlayed on each other, as well as a scheme for blending the overlapping parts. The default Android way of composing images is PorterDuff.Mode.SRC_OVER, which equates to … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)