让图片高斯模糊

代码如下:
s 路径=图片
//示范路径="@图片.png"
s 半径="10"
s 模糊度 ="50"
cls("android.graphics.Bitmap",图像类)
cls("android.renderscript.RenderScript",高斯类)
cls("android.renderscript.Element",指针类)
cls("android.renderscript.ScriptIntrinsicBlur",模糊类)
cls("android.renderscript.Allocation",计算类)
sbp(路径,img)
javax(bmpw, img, 图像类,"getWidth")
s(bmpw/半径,bmpw)
javax(bmph, img, 图像类,"getHeight")
s(bmph/半径,bmph)
javax(img,null,图像类,"createScaledBitmap",图像类,img,"int",bmpw,"int",bmph,"boolean",false)
javax(rs,null,高斯类,"create","android.content.Context",activity)
javax(eme,null,指针类,"U8_4",高斯类,rs)
javax(sb,null,模糊类,"create",高斯类,rs,指针类,eme)
javax(inp,null,计算类,"createFromBitmap",高斯类,rs,图像类,img)
javax(inpget,inp,计算类,"getType")
javax(otp,null,计算类,"createTyped",高斯类,rs,"android.renderscript.Type",inpget)
javax(null,sb,模糊类,"setRadius","float",模糊度)
javax(null,sb,模糊类,"setInput",计算类,inp)
javax(null,sb,模糊类,"forEach",计算类,otp)
javax(null,otp,计算类,"copyTo",图像类,img)
javax(null,rs,高斯类,"destroy")
java(null,sb,"android.renderscript.BaseObj.destroy")
us(1,"background",img)
//这里是控件ID

模糊图片,有些图模糊后让人产生想象力

© 版权声明
THE END
喜欢就支持一下吧
点赞6 分享
评论 抢沙发

请登录后发表评论