mjmmusser
10-28-2004, 12:14 AM
I don't quite know how to save a file in a different file extension. I want to take an image file and save it as a .bit file(for my cell phone). At this moment I have to go in and manually edit the header. I want to open the Image file and save it as a bit by making the header 80 00 80 00 in hex :confused: . any help would be appreaciated.
thnx--Mike
passel
10-28-2004, 06:53 AM
Does manually editing the header and saving it with a .bit extension work?
If that is all you need to do, then you can use the "Name" Statement to rename the file.
You can open the file using Binary Mode and change those four bytes.
i.e.
Dim b as Byte
Open "C:\file.bit" for Binary as #1
Put #1, 11, b
Put #1, 13, b
b = &H80 'or 128
Put #1, 10, b
Put #1, 12, b
Close #1
The above code assumes the 80 00 80 00 had to be put at bytes 10-13 within the header.
You do what you need to do.
See the ...
p.s. The above was just typed in and not entered into VB or tested, but should be correct.