62,614
社区成员
发帖
与我相关
我的任务
分享
ImageLoader loader = new ImageLoader();
loader.load("1.jpg");
Image src = new Image(null, loader.data[0]);
int width = src.getImageData().width;
int height = src.getImageData().height;
int ratio = 10;
Image result = new Image(null, width * ratio, height * ratio);
GC gc = new GC(result);
gc.setAdvanced(true);
gc.drawImage(src, 0, 0, width, height, 0, 0, width * ratio, height * ratio);
loader.data[0] = result.getImageData();
loader.save("2.jpg", SWT.IMAGE_JPEG);