Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

21
LINES

< > BotCompany Repo | #1035936 // saveQOI

JavaX fragment (include) [tags: use-pretranspiled]

Uses 38K of libraries. Click here for Pure Java version (9187L/51K).

1  
!include once #1035902 // QOI Library [Include]
2  
3  
svoid saveQOI(BufferedImage img, File file) ctex {
4  
  new QOIImageWriterSPI spi;
5  
  var imageWriter = spi.createWriterInstance();
6  
  
7  
  try {
8  
    //var stream = spi.createOutputStreamInstance(file);
9  
    var stream = ImageIO.createImageOutputStream(file);
10  
    imageWriter.setOutput(stream);
11  
    imageWriter.write(img);
12  
  } finally {
13  
    imageWriter.dispose();
14  
  }
15  
  
16  
  vmBus_send wroteFile(file);
17  
}
18  
19  
svoid saveQOI(File file, BufferedImage img) {
20  
  saveQOI(img, file);
21  
}

Author comment

Began life as a copy of #1004891

download  show line numbers  debug dex  old transpilations   

Travelled to 2 computer(s): mqqgnosmbjvj, wnsclhtenguj

No comments. add comment

Snippet ID: #1035936
Snippet name: saveQOI
Eternal ID of this version: #1035936/5
Text MD5: 0479ef4eda5aae1cac4ca1f482896af6
Transpilation MD5: f5aa28b5132071722f06bc7cbd735556
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-08-15 17:27:44
Source code size: 534 bytes / 21 lines
Pitched / IR pitched: No / No
Views / Downloads: 139 / 202
Version history: 4 change(s)
Referenced in: [show references]