fbpx
< 戻る
印刷

指定した高さにリサイズ

どんな処理ができますか?

指定した高さにリサイズは、設定したピクセル数の高さになるように画像をリスケーリングします。

JavaでBufferedImageを使った指定した高さにリサイズ処理

				
					ImageProcessingOperations operations = new ImageProcessingOperations();

// ここでは、スケール、ぼかしなど、いくつかの操作を連鎖させることができます。
operations.resizeToHeight(100); // 画像の高さを100ピクセルに設定
        
// BufferedImageへの操作の適用
BufferedImage modifiedImage = operations.apply(BufferedImage originalImage);
				
			

指定した高さにリサイズに関するJavadocを見る

その他のコード例

以下のコード例を使用して、画像フォーマットを処理および変換します:

Fileの使用
				
					File inputFile = new File("path/to/file");
File outputFile = new File("path/to/output-blurred-file");
JDeli.convert(inputFile, outputFile, operations);
				
			
InputStreamとOutputStreamの使用
				
					final InputStream inputStream = new FileInputStream(inputFile);
final OutputStream outputStream = new FileOutputStream(outputFile);
final String outputFormat = "format"; // 出力ファイルの形式(例:png、jpeg、...;
JDeli.convert(inputStream, outputStream, outputFormat, operations);
				
			
byte[]の使用
				
					byte[] inputData = Files.readAllBytes(Paths.get("/path/to/file"));
final String outputFormat = "format"; // 出力ファイルの形式(例:png、jpeg、...;
byte[] outputData = JDeli.convert(inputData, outputFormat, operations);
				
			
    MENU
    PAGE TOP