有人能帮忙提供一些JavaFx创建图像缩略图的代码吗?
我是新手,所以需要逐步解释说明。
您可以使用Image构造函数从较大的图像创建缩略图,以下是来自Image javadoc的示例:
// load an image and resize it to width of 100 while preserving its
// original aspect ratio, using faster filtering method
// The image is downloaded from the supplied URL through http protocol
Image image3 = new Image("http://sample.com/res/flower.png", 100, 0, false, false);
ImageView imageView = new ImageView(image);