android绘制圆角矩形为什么圆角边粗了 用shapedrawable画一个圆角矩形作为按钮的background,但是圆角的地方总是有点粗,和直接用xml做出来的背景不一样
微信小程序如何设置canvas背景图等比缩放圆角,在微信小程序开发中,可以使用cava画布,绘制矢量图形。那么,微信小程序如何设置cava背景图等比缩放圆角?
怎么用canvas在bitmap上画个边框? Bitmapoutput=Bitmap.createBitmap(bitmap.getWidth(),bitmap.getHeight(),Config.ARGB_8888);Canvas canvas=new Canvas(output);final Paint paint=new Paint();final Rect rect=new Rect(0,0,bitmap.getWidth(),bitmap.getHeight());final RectF rectF=new RectF(rect);paint.setAntiAlias(true);canvas.drawARGB(0,0,0,0);canvas.drawRoundRect(rectF,20.0f,20.0f,paint);paint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN));canvas.drawBitmap(bitmap,rect,rect,paint);return output;