小工具知识网

当前位置: 首页 > 行业知识 > 生成随机图片

行业知识

生成随机图片

2026-11-12 06:39:43 来源:互联网转载
package com.zhuguohui.app.lib.tools;/** * Created by zhuguohui * Date: 2024/6/1 * Time: 13:39 * Desc:获取随机图片 */public class RandomImage {//    static final String url= "https://picsum.photos/%d/%d?random=%d";    static final String url= "https://source.unsplash.com/%dx%d/?beauty&random=%d";    public static String get(int width,int height){        return String.format(url,width,height,(int)(Math.random()*100));    }}

上面的代码index.php/tags-653.html" >可以生成随机图片。而且内容可以指定 **“https://source.unsplash.com/%dx%d/?beauty&random=%d”**比如?后面的beauty返回的就是美女图片

效果

上一篇:星美人秋季浇水秘籍,轻松掌握技巧,美丽不再难求!

下一篇:种子怎么下载?