js生成随即字符串 /* *js生成随即字符串原来如此简单 *toString() radix argument must be between 2 and 36 */ function uuid() { return Math.random().toString(36).substring(3, 8) } //7rh32
这是另一种用UUID生成随机字符串的方法. public class RandomGenerator{ private int length; public void setLength(int length) { this.length = length; } public RandomGenerator(int length){ this.length=length; } public RandomGenerator(){ this.length=32; } public String ge
一般要做正圆形图片,只能是正方形的基础上才能实现,否则就变成椭圆了,下面说说如何使长方形的图片生成正圆形图片 废话不多说,没图没真相,先上图吧: 原图: 变成正圆后: 下面上代码: public static Bitmap makeRoundCorner(Bitmap bitmap) { int width = bitmap.getWidth(); int height = bitmap.getHeight(); int left = 0, top = 0, right = width, b