Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Convert an image to *.ico format

Reply
Thread Tools

Convert an image to *.ico format

 
 
angelayoub
Guest
Posts: n/a
 
      11-24-2006
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.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Want help on how we convert output to tabular format Using the expat parser (http://expat.sourceforge.net/) i have to parse the following xml file and print it on the screen in tabular format. sharan XML 1 10-26-2007 01:20 PM
URGENT,how to convert PGM image or raw format to JPG,PNG format, bharath Java 4 03-16-2007 10:52 AM
convert different video format (avi,mpeg,mp4, etc) file to a flash format solomon_13000@yahoo.com C++ 1 09-11-2006 06:15 PM
need code to convert float format to internal java float format which is kept in 4 bytes integer Andy Java 7 05-10-2004 09:26 PM
convert a tiff image to another format (using JAI ?) cyril Java 1 09-08-2003 01:29 PM



Advertisments