Convert an image to *.ico format

A

angelayoub

Hello!
i'm using the API JIMI (Java Image Mangement Interface) and i would like
to convert any image like gif, jpg, bmp,... to an image *.ico,i have used
this first part of source code in my program

Image img=Jimi.getImage("a.jpg");
Jimi.putImage(img,"a.ico");

but i have got this Exception "Cannot find encoder for a.ico" when i
executed my program, after that i have tried to use an other possible
source code which is

Jimi.setDefaultFlags(Jimi.VIRTUAL_MEMORY);
String str="a.jpg";
String s="a.ico";
Image img=Jimi.getImage(str);
File f=new File(s);
FileOutputStream out = new FileOutputStream(f);
ICOEncoder ico = new ICOEncoder();
JimiReader jir=Jimi.createJimiReader(str);
ico.encodeImage(jir.getRasterImage(),out);

but i have faced the exception exception of image/x-icone exception it
require the palette image

i was wondering if someone would mind helping me to solve this problem or
giving me any suggestion for help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top