JAVA 截图代码

JAVA 截图代码


2024年4月14日发(作者:)

package img;

import edImage;

import ;

import tFoundException;

import ption;

import O;

public class ImgSub

{

public static void main(String[] args)

{

String input = "D:";

String output = "D:";

BufferedImage img = readBufferedImage(input); //读取源图

int startX = 0,startY = 0; //截图的起点

int subWidth = th()-100,subHeight = ght()-100 ; //截图

后的大小

BufferedImage outImg =

BufferedImage(subWidth,subHeight,_INT_RGB);

subImage(img, outImg, startX, startY, subWidth, subHeight);

writeImg(output, outImg); //写出截好的图片

}

public static void subImage(BufferedImage src,BufferedImage

startX,int startY,int subWidth,int subHeight)

{

int i=0,j=0;

try

{

for(i=0;i< subWidth;i++) //循环行 y坐标

new

dest,int


发布者:admin,转转请注明出处:http://www.yc00.com/web/1713109409a2184809.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信