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

9
LINES

< > BotCompany Repo | #1030151 // toICO - BufferedImage to .ico byte array (e.g. favicon.ico)

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

Uses 30K of libraries. Click here for Pure Java version (2524L/16K).

lib 1400188 // image4j (https://sourceforge.net/projects/image4j/files/image4j-core/0.7.2/)

import net.sf.image4j.codec.ico.ICOEncoder;

static byte[] toICO(BufferedImage img) ctex {
  new ByteArrayOutputStream baos;
  ICOEncoder.write(img, baos);
  ret baos.toByteArray();
}

Author comment

Began life as a copy of #1021826

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1030151
Snippet name: toICO - BufferedImage to .ico byte array (e.g. favicon.ico)
Eternal ID of this version: #1030151/2
Text MD5: 8e4728c8915f6e831d6804d42838392d
Transpilation MD5: 92c060e002406c84494f927cf0db8881
Author: stefan
Category: javax / imaging
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-11-11 16:33:14
Source code size: 284 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 128 / 177
Version history: 1 change(s)
Referenced in: [show references]