截屏+高斯
来源:互联网 发布:小米网络电话费流量吗 编辑:程序博客网 时间:2024/05/20 16:36
1截屏:
static public Bitmap takeScreen(final Context ctx,boolean isCuteImage) { View view = ((Activity) ctx).getWindow().getDecorView(); view.destroyDrawingCache(); view.setDrawingCacheEnabled(true); Bitmap bmp = view.getDrawingCache(); if (isCuteImage) {// 截取图片部分 // new bmp = getCuteStatusBarBmp(bmp, ctx); } return bmp;}
/** * 获得剪切掉状态栏的图片 Methods Name: getCuteStatusBarBmp * * @param bmp * @param ctx * @return Comments: * @author Bear Description: */public static Bitmap getCuteStatusBarBmp(Bitmap bmp, Context ctx) { if (bmp != null) { int statusBarHeight = DeviceInfoUtils.getStatusBarHeight((Activity) ctx); int y = statusBarHeight; int x = 0; int height = bmp.getHeight() - statusBarHeight; int width = bmp.getWidth(); bmp = Bitmap.createBitmap(bmp, x, y, width, height); } return bmp;}new Thread(new Runnable() { @Override public void run() {2压缩: float scaleFactor = 8; Bitmap overlay = Bitmap.createBitmap((int)(cover_blurimg.getWidth()/scaleFactor), (int)(cover_blurimg.getHeight()/scaleFactor), Bitmap.Config.ARGB_4444); Canvas canvas = new Canvas(overlay);// canvas.translate(-blur_img.getLeft()/scaleFactor, -blur_img.getTop()/scaleFactor); canvas.scale(1 / scaleFactor, 1 / scaleFactor); Paint paint = new Paint(); paint.setFlags(Paint.FILTER_BITMAP_FLAG); canvas.drawBitmap(cover_blurimg, 0, 0, paint);3模糊: blurimg = Tool.fast_blur(overlay, 25); Log.i("mohuwanbi------------->",""+System.currentTimeMillis()); Message msg = mHandler.obtainMessage(); msg.what=101; mHandler.sendMessageDelayed(msg,10); } }).start();
0 0
- 截屏+高斯+获取宽高
- 截屏+高斯
- 截屏 高斯模糊效果
- 高斯
- 高斯
- 高斯
- 高斯
- 高斯
- 高斯
- 高斯,为什么总是高斯分布?
- 高斯过滤得到高斯模板
- 高斯噪声与高斯滤波
- Android高性能高斯模糊方案
- Android高性能高斯模糊方案
- 高斯模糊与高反差保留
- 高斯的故事
- 高斯模糊模块
- 高斯积分
- 一款android平台测试电量的app————PowerTutor
- Uri详解之——Uri结构与代码提取
- 冒泡,选择,快排,归并
- WebView shouldOverrideUrlLoading 方法使用不当导致 服务端获取父url 失败
- java代理模式
- 截屏+高斯
- Python网络数据采集9(译者:哈雷)
- C语言使用正则表达式
- UVA10603 dijkstra最短路
- 本地选择图库照片,保存在本地新建文件夹
- 方格取数 纪中2541 类dp
- [2016JZSC Part 2] 【NOIP2016提高A组模拟8.11】总结
- 文件分隔符
- Unity Physics.Raycast 深入理解