html中js实现div自由移动

java切图片,把1个大图切成9个小图. 代码原文:https://blog.youkuaiyun.com/coldcoding/article/details/55667037

public static void main(String[] args) {
        // https://blog.youkuaiyun.com/coldcoding/article/details/55667037
        //imageIO或者fileIO能够读取图像
        //BufferedImage创建一个实际的图像缓冲区,可以直接操作像素
        //bufferedImage.getSbuImage返回由指定矩形区域定义的子图像。
        //返回的 BufferedImage 与源图像共享相同的数据数组。
        String scrImageFile = "E:\\fu2.png";
        String targetDir = "img";
        BufferedImage img = null;
        BufferedImage scrImage = null;
        try {
            scrImage = ImageIO.read(new File(scrImageFile));
        } catch (IOException e) {
            e.printStackTrace();
        }
        int scrHeight = scrImage.getHeight();
        int divHeight = scrHeight / 3;
        int scrWidth = scrImage.getWidth();
        int divWidth = scrWidth / 3;
        System.out.println("width " + scrWidth);
  
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值