[ Home  |  FAQ-Related Q&As  |  General Q&As  |  Answered Questions ]


    Search the Q&A Archives


...change file types from .gif to .ico email me:...

<< Back to: Graphics File Formats FAQ (Part 1 of 4): General Graphics Format Questions

Question by stulric
Submitted on 1/4/2004
Related FAQ: Graphics File Formats FAQ (Part 1 of 4): General Graphics Format Questions
Rating: Rate this question: Vote
How can I change file types from .gif to .ico
email me: bernardbernier@hotmail.com


Answer by chotu
Submitted on 3/24/2004
Rating:  Rate this answer: Vote
i want to change my password

 

Answer by Leaky Roof
Submitted on 3/20/2005
Rating: Not yet rated Rate this answer: Vote
03/20/2005
Stulric,

I just completed a program in Power Basic to create .ico files from 32 x 32 pixel (16 color palette) .bmp files.  Accordingly, if you can convert your .gif file to .bmp and then reduce it to 32 x 32 pixels and reload and resave it under 16 colors (4 bits) this program may be just the thing for you.

The program follows.  Note that my editor depends upon 80 character lines.  You may have to edit the following, especially the DATA, comment, and PRINT lines to combine two lines into one so that the carriage return or other delimiters are properly observed.  The DATA lines are generally broken into 16 data items per line, 4 groups of four each.  I have checked and tested the results of this program only briefly, but it seems to produce a working .ico file.  "Leaky Roof"

cls
PRINT "This program will produce an .ico file from a .bmp file that is"
PRINT "itself created as a 32 x 32 pixel image using only a 16 color"
PRINT "palette."
ErrorLoop:
PRINT
PRINT "Name you want to give to .ico file that will be produced "
PRINT "(use only 8 characters)"
PRINT "(note that A:\ will be automatically prepended and .ICO will be"
PRINT "automatically appended.):"
INPUT Filename1$
IF Len(Filename1$) < 9 Then GOTO Continue1 Else GoTo ErrorLoop1
ErrorLoop1:
Beep: Print "TOO LONG OF NAME!"
GoTo ErrorLoop

Continue1:
Filename1$ = "A:" + Filename1$ + ".ICO"

ErrorLoop3:
PRINT
PRINT "Now type the name of the .bmp file to be inserted into this new"
PRINT ".ico file (8 characters or less, and note that A:\ will"
PRINT "automatically be prepended and .BMP will automatically be"
PRINT "appended):"
INPUT Filename2$
If Len(Filename2$) < 9 Then GOTO Continue2 Else Goto ErrorLoop4
ErrorLoop4:
Beep: Print "TOO LONG OF NAME!"
GoTo ErrorLoop3

Continue2:
Filename2$ = "A:" + Filename2$ + ".BMP"

'Following are the first 126 bytes to go into typical .ico file created
'by Visual Basic 1.0.

DATA 000,000,001,000,  001,000,032,032,  016,000,000,000,  000,000,232,002
DATA 000,000,022,000,  000,000,040,000,  000,000,032,000,  000,000,064,000
DATA 000,000,001,000,  004,000,000,000,  000,000,000,000,  000,000,000,000
DATA 000,000,000,000,  000,000,016,000,  000,000,000,000,  000,000,000,000
DATA 000,000,000,000,  128,000,000,128,  000,000,000,128,  128,000,128,000
DATA 000,000,128,000,  128,000,128,128,  000,000,192,192,  192,000,128,128
DATA 128,000,000,000,  255,000,000,255,  000,000,000,255,  255,000,255,000
DATA 000,000,255,000,  255,000,255,255,  000,000,255,255,  255,000

'Following are the last 128 bytes to go into typical .ico file created
'by Visual Basic 1.0.
DATA 000,000,000,000,  000,000,000,000,  000,000,000,000,  000,000,000,000
DATA 000,000,000,000,  000,000,000,000,  000,000,000,000,  000,000,000,000
DATA 000,000,000,000,  000,000,000,000,  000,000,000,000,  000,000,000,000
DATA 000,000,000,000,  000,000,000,000,  000,000,000,000,  000,000,000,000
DATA 000,000,000,000,  000,000,000,000,  000,000,000,000,  000,000,000,000
DATA 000,000,000,000,  000,000,000,000,  000,000,000,000,  000,000,000,000
DATA 000,000,000,000,  000,000,000,000,  000,000,000,000,  000,000,000,000
DATA 000,000,000,000,  000,000,000,000,  000,000,000,000,  000,000,000,000

print "Putting first 126 bytes into the new .ico file (header) called"
print Filename1$

open Filename1$ as #1 Len=1: 'The new .ico file
Field #1, 1 as A$
CountForFile1 = 0
For X = 1 to 126
READ AA
Lset A$=Chr$(AA)
CountForFile1 = CountForFile1 + 1
Put #1, CountForFile1
Next X

Print "Now adding bitmap data from known .BMP file to the new .ICO file."

Open Filename2$ AS #2 Len=1: 'The .bmp file.
Field #2, 1 As B$
For X=119 To 630
Get #2, X
Lset A$=B$
CountForFile1 = CountForFile1 + 1
Put #1, CountForFile1
Next X
Close #2

Print
Print "Now adding footer to new .ico file."

For X=1 to 128
Read AA
CountForFile1 = CountForFile1 + 1
Lset A$=Chr$(AA)
Put #1, CountForFile1
Next X
Close #1
Print
print "Done."
End



 

Your answer will be published for anyone to see and rate.  Your answer will not be displayed immediately.  If you'd like to get expert points and benefit from positive ratings, please create a new account or login into an existing account below.


Your name or nickname:
If you'd like to create a new account or access your existing account, put in your password here:
Your answer:

FAQS.ORG reserves the right to edit your answer as to improve its clarity.  By submitting your answer you authorize FAQS.ORG to publish your answer on the WWW without any restrictions. You agree to hold harmless and indemnify FAQS.ORG against any claims, costs, or damages resulting from publishing your answer.

 

FAQS.ORG makes no guarantees as to the accuracy of the posts. Each post is the personal opinion of the poster. These posts are not intended to substitute for medical, tax, legal, investment, accounting, or other professional advice. FAQS.ORG does not endorse any opinion or any product or service mentioned mentioned in these posts.

 

<< Back to: Graphics File Formats FAQ (Part 1 of 4): General Graphics Format Questions


[ Home  |  FAQ-Related Q&As  |  General Q&As  |  Answered Questions ]

© 2008 FAQS.ORG. All rights reserved.