Bitmap photo = BitmapFactory.decodeResource(r, res);Bitmap icon = Bitmap.createBitmap(width, hight, Bitmap.Config.ARGB_8888); //建立一个空的BItMapCanvas canvas = new Canvas(icon);//初始化画布 绘制的图像到icon上Paint photoPaint = new Paint(); //建立画笔photoPaint.setDither(true); //获取跟清晰的图像采样photoPaint.setFilterBitmap(true);//过滤一些Rect src = new Rect(0, 0, photo.getWidth(), photo.getHeight());//创建一个指定的新矩形的坐标Rect dst = new Rect(0, 0, width, hight);//创建一个指定的新矩形的坐标canvas.drawBitmap(photo, src, dst, photoPaint);//将photo 缩放或则扩大到 dst使用的填充区photoPaintPaint textPaint = new Paint(Paint.ANTI_ALIAS_FLAG | Paint.DEV_KERN_TEXT_FLAG);//设置画笔textPaint.setTextSize(20.0f);//字体大小textPaint.setTypeface(Typeface.DEFAULT_BOLD);//采用默认的宽度textPaint.setColor(Color.RED);//采用的颜色textPaint.setShadowLayer(3f, 1, 1,r.getColor(android.R.color.background_dark));//影音的设置canvas.drawText(str, 20, 26, textPaint);//绘制上去 字,开始未知x,y采用那只笔绘制 

更多相关文章

  1. 【android】模拟点击某个指定坐标作用在View上
  2. 检测Android中触摸屏手势的动作与坐标
  3. 布局文件绘制圆角矩形 背景图片
  4. android实现圆角矩形背景的方法
  5. 火星坐标系 (GCJ-02) 与百度坐标系 (BD-09) 的转换算法(android)
  6. android中的坐标变换
  7. Android在源图片上的XY坐标再画一个图片
  8. Android23-视图坐标系以及MotionEvent事件

随机推荐

  1. [Mugeda HTML5技术教程之18]如何在Androi
  2. Android(安卓)bitmap图片处理
  3. Android实现图文混排的笔记·终篇
  4. Android(安卓)RxJava:图文详解 变换操作符
  5. Android(安卓)实现通话监听
  6. Android初体验
  7. android中轮播图的实现
  8. [开源c-FFMpeg]Android(安卓)add prebuil
  9. 移动开发参考书之Android篇
  10. Android内核详解之Low memory killer