Home » Archimedes archive » Acorn Computing » 1994 02.adf » 9402 » Miscellany/To_FromBMP/!FromBMP/!Help
Miscellany/To_FromBMP/!FromBMP/!Help
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
| Tape/disk: | Home » Archimedes archive » Acorn Computing » 1994 02.adf » 9402 |
| Filename: | Miscellany/To_FromBMP/!FromBMP/!Help |
| Read OK: | ✔ |
| File size: | 08EB bytes |
| Load address: | 0000 |
| Exec address: | 0000 |
Duplicates
There is 1 duplicate copy of this file in the archive:
- Archimedes archive » Acorn Computing » 1994 02.adf » 9402 » Miscellany/To_FromBMP/!FromBMP/!Help
- Recent acquisitions » Acorn ADFS disks » adfs_AcornComputing_199402.adf » 9402 » Miscellany/To_FromBMP/!FromBMP/!Help
File contents
_____________________________________________________________________________
FromBMP
version 1.01 (11 Oct 1993)
written by David Thomas
for Acorn Computing � 1993
_____________________________________________________________________________
Purpose ___________________________________________________________________
BMP is the format mainly used for graphical interchange in the Microsoft
Windows environment for PC-compatible machines. Since many RISC OS users
also use PCs on a regular basis, it's handy to be able to convert between
BMP and the native formats on RISC OS (Sprite and Clear).
The FromBMP application will convert BMP format pictures to Sprites (or
Clear files if the BMP is 24bpp).
This application is complemented by the ToBMP convertor. Which provides
conversion to the BMP format (hence the name).
Usage _____________________________________________________________________
When you want a file converting from BMP you should ensure that it has the
filetype &69C and drag it to the FromBMP icon on the icon bar. The file
will be accessed to determine the amount of colours in the image and an
appropriate save box will appear. When you save, the image will be
converted from BMP and written out.
The saved file will be in either Sprite or Clear format, if the input BMP
file was 8bpp the resulting Sprite will be in the RISC OS 3 256-entry format
which some applications don't like, if this is a problem then put the image
through a recent version of Translator or ChangeFSI to get a standard Sprite
(although this will result in loss of colour resolution). The Sprite is
given the name of the file's leafname (the bit after the last dot in the
filename). Clear is only used for 24bpp images, it can be displayed using
Translator, ChangeFSI, TrueView, Clearly etc. Again you can put the image
through Translator or ChangeFSI to turn it into a Sprite.
One of the reasons why I wrote this program is that Translator and
ChangeFSI have problems when reading certain BMPs, as they incorrectly
calculate the word-aligned line lengths, tut tut!
When writing out a Sprite, the mode it is given will be either, 25, 27 or
28.
00000000 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f |________________| * 00000040 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 0a 0a 20 |_____________.. | 00000050 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00000070 20 20 46 72 6f 6d 42 4d 50 0a 0a 20 20 20 20 20 | FromBMP.. | 00000080 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000090 20 20 20 20 20 76 65 72 73 69 6f 6e 20 31 2e 30 | version 1.0| 000000a0 31 20 28 31 31 20 4f 63 74 20 31 39 39 33 29 0a |1 (11 Oct 1993).| 000000b0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 000000c0 20 20 20 20 20 20 20 20 20 20 20 20 77 72 69 74 | writ| 000000d0 74 65 6e 20 62 79 20 44 61 76 69 64 20 54 68 6f |ten by David Tho| 000000e0 6d 61 73 0a 20 20 20 20 20 20 20 20 20 20 20 20 |mas. | 000000f0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6f | fo| 00000100 72 20 41 63 6f 72 6e 20 43 6f 6d 70 75 74 69 6e |r Acorn Computin| 00000110 67 20 a9 20 31 39 39 33 0a 5f 5f 5f 5f 5f 5f 5f |g . 1993._______| 00000120 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f |________________| * 00000160 5f 5f 5f 5f 5f 5f 0a 0a 20 50 75 72 70 6f 73 65 |______.. Purpose| 00000170 20 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f | _______________| 00000180 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f |________________| * 000001b0 5f 5f 5f 5f 0a 0a 20 42 4d 50 20 69 73 20 74 68 |____.. BMP is th| 000001c0 65 20 66 6f 72 6d 61 74 20 6d 61 69 6e 6c 79 20 |e format mainly | 000001d0 75 73 65 64 20 66 6f 72 20 67 72 61 70 68 69 63 |used for graphic| 000001e0 61 6c 20 69 6e 74 65 72 63 68 61 6e 67 65 20 69 |al interchange i| 000001f0 6e 20 74 68 65 20 4d 69 63 72 6f 73 6f 66 74 0a |n the Microsoft.| 00000200 57 69 6e 64 6f 77 73 20 65 6e 76 69 72 6f 6e 6d |Windows environm| 00000210 65 6e 74 20 66 6f 72 20 50 43 2d 63 6f 6d 70 61 |ent for PC-compa| 00000220 74 69 62 6c 65 20 6d 61 63 68 69 6e 65 73 2e 20 |tible machines. | 00000230 20 53 69 6e 63 65 20 6d 61 6e 79 20 52 49 53 43 | Since many RISC| 00000240 20 4f 53 20 75 73 65 72 73 0a 61 6c 73 6f 20 75 | OS users.also u| 00000250 73 65 20 50 43 73 20 6f 6e 20 61 20 72 65 67 75 |se PCs on a regu| 00000260 6c 61 72 20 62 61 73 69 73 2c 20 69 74 27 73 20 |lar basis, it's | 00000270 68 61 6e 64 79 20 74 6f 20 62 65 20 61 62 6c 65 |handy to be able| 00000280 20 74 6f 20 63 6f 6e 76 65 72 74 20 62 65 74 77 | to convert betw| 00000290 65 65 6e 0a 42 4d 50 20 61 6e 64 20 74 68 65 20 |een.BMP and the | 000002a0 6e 61 74 69 76 65 20 66 6f 72 6d 61 74 73 20 6f |native formats o| 000002b0 6e 20 52 49 53 43 20 4f 53 20 28 53 70 72 69 74 |n RISC OS (Sprit| 000002c0 65 20 61 6e 64 20 43 6c 65 61 72 29 2e 0a 0a 20 |e and Clear)... | 000002d0 54 68 65 20 46 72 6f 6d 42 4d 50 20 61 70 70 6c |The FromBMP appl| 000002e0 69 63 61 74 69 6f 6e 20 77 69 6c 6c 20 63 6f 6e |ication will con| 000002f0 76 65 72 74 20 42 4d 50 20 66 6f 72 6d 61 74 20 |vert BMP format | 00000300 70 69 63 74 75 72 65 73 20 74 6f 20 53 70 72 69 |pictures to Spri| 00000310 74 65 73 20 28 6f 72 0a 43 6c 65 61 72 20 66 69 |tes (or.Clear fi| 00000320 6c 65 73 20 69 66 20 74 68 65 20 42 4d 50 20 69 |les if the BMP i| 00000330 73 20 32 34 62 70 70 29 2e 20 0a 0a 20 54 68 69 |s 24bpp). .. Thi| 00000340 73 20 61 70 70 6c 69 63 61 74 69 6f 6e 20 69 73 |s application is| 00000350 20 63 6f 6d 70 6c 65 6d 65 6e 74 65 64 20 62 79 | complemented by| 00000360 20 74 68 65 20 54 6f 42 4d 50 20 63 6f 6e 76 65 | the ToBMP conve| 00000370 72 74 6f 72 2e 20 20 57 68 69 63 68 20 70 72 6f |rtor. Which pro| 00000380 76 69 64 65 73 0a 63 6f 6e 76 65 72 73 69 6f 6e |vides.conversion| 00000390 20 74 6f 20 74 68 65 20 42 4d 50 20 66 6f 72 6d | to the BMP form| 000003a0 61 74 20 28 68 65 6e 63 65 20 74 68 65 20 6e 61 |at (hence the na| 000003b0 6d 65 29 2e 0a 0a 20 55 73 61 67 65 20 5f 5f 5f |me)... Usage ___| 000003c0 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f |________________| * 00000400 5f 5f 0a 0a 20 57 68 65 6e 20 79 6f 75 20 77 61 |__.. When you wa| 00000410 6e 74 20 61 20 66 69 6c 65 20 63 6f 6e 76 65 72 |nt a file conver| 00000420 74 69 6e 67 20 66 72 6f 6d 20 42 4d 50 20 79 6f |ting from BMP yo| 00000430 75 20 73 68 6f 75 6c 64 20 65 6e 73 75 72 65 20 |u should ensure | 00000440 74 68 61 74 20 69 74 20 68 61 73 20 74 68 65 0a |that it has the.| 00000450 66 69 6c 65 74 79 70 65 20 26 36 39 43 20 61 6e |filetype &69C an| 00000460 64 20 64 72 61 67 20 69 74 20 74 6f 20 74 68 65 |d drag it to the| 00000470 20 46 72 6f 6d 42 4d 50 20 69 63 6f 6e 20 6f 6e | FromBMP icon on| 00000480 20 74 68 65 20 69 63 6f 6e 20 62 61 72 2e 20 20 | the icon bar. | 00000490 54 68 65 20 66 69 6c 65 0a 77 69 6c 6c 20 62 65 |The file.will be| 000004a0 20 61 63 63 65 73 73 65 64 20 74 6f 20 64 65 74 | accessed to det| 000004b0 65 72 6d 69 6e 65 20 74 68 65 20 61 6d 6f 75 6e |ermine the amoun| 000004c0 74 20 6f 66 20 63 6f 6c 6f 75 72 73 20 69 6e 20 |t of colours in | 000004d0 74 68 65 20 69 6d 61 67 65 20 61 6e 64 20 61 6e |the image and an| 000004e0 0a 61 70 70 72 6f 70 72 69 61 74 65 20 73 61 76 |.appropriate sav| 000004f0 65 20 62 6f 78 20 77 69 6c 6c 20 61 70 70 65 61 |e box will appea| 00000500 72 2e 20 20 57 68 65 6e 20 79 6f 75 20 73 61 76 |r. When you sav| 00000510 65 2c 20 74 68 65 20 69 6d 61 67 65 20 77 69 6c |e, the image wil| 00000520 6c 20 62 65 0a 63 6f 6e 76 65 72 74 65 64 20 66 |l be.converted f| 00000530 72 6f 6d 20 42 4d 50 20 61 6e 64 20 77 72 69 74 |rom BMP and writ| 00000540 74 65 6e 20 6f 75 74 2e 0a 0a 20 54 68 65 20 73 |ten out... The s| 00000550 61 76 65 64 20 66 69 6c 65 20 77 69 6c 6c 20 62 |aved file will b| 00000560 65 20 69 6e 20 65 69 74 68 65 72 20 53 70 72 69 |e in either Spri| 00000570 74 65 20 6f 72 20 43 6c 65 61 72 20 66 6f 72 6d |te or Clear form| 00000580 61 74 2c 20 69 66 20 74 68 65 20 69 6e 70 75 74 |at, if the input| 00000590 20 42 4d 50 0a 66 69 6c 65 20 77 61 73 20 38 62 | BMP.file was 8b| 000005a0 70 70 20 74 68 65 20 72 65 73 75 6c 74 69 6e 67 |pp the resulting| 000005b0 20 53 70 72 69 74 65 20 77 69 6c 6c 20 62 65 20 | Sprite will be | 000005c0 69 6e 20 74 68 65 20 52 49 53 43 20 4f 53 20 33 |in the RISC OS 3| 000005d0 20 32 35 36 2d 65 6e 74 72 79 20 66 6f 72 6d 61 | 256-entry forma| 000005e0 74 0a 77 68 69 63 68 20 73 6f 6d 65 20 61 70 70 |t.which some app| 000005f0 6c 69 63 61 74 69 6f 6e 73 20 64 6f 6e 27 74 20 |lications don't | 00000600 6c 69 6b 65 2c 20 69 66 20 74 68 69 73 20 69 73 |like, if this is| 00000610 20 61 20 70 72 6f 62 6c 65 6d 20 74 68 65 6e 20 | a problem then | 00000620 70 75 74 20 74 68 65 20 69 6d 61 67 65 0a 74 68 |put the image.th| 00000630 72 6f 75 67 68 20 61 20 72 65 63 65 6e 74 20 76 |rough a recent v| 00000640 65 72 73 69 6f 6e 20 6f 66 20 54 72 61 6e 73 6c |ersion of Transl| 00000650 61 74 6f 72 20 6f 72 20 43 68 61 6e 67 65 46 53 |ator or ChangeFS| 00000660 49 20 74 6f 20 67 65 74 20 61 20 73 74 61 6e 64 |I to get a stand| 00000670 61 72 64 20 53 70 72 69 74 65 0a 28 61 6c 74 68 |ard Sprite.(alth| 00000680 6f 75 67 68 20 74 68 69 73 20 77 69 6c 6c 20 72 |ough this will r| 00000690 65 73 75 6c 74 20 69 6e 20 6c 6f 73 73 20 6f 66 |esult in loss of| 000006a0 20 63 6f 6c 6f 75 72 20 72 65 73 6f 6c 75 74 69 | colour resoluti| 000006b0 6f 6e 29 2e 20 20 54 68 65 20 53 70 72 69 74 65 |on). The Sprite| 000006c0 20 69 73 0a 67 69 76 65 6e 20 74 68 65 20 6e 61 | is.given the na| 000006d0 6d 65 20 6f 66 20 74 68 65 20 66 69 6c 65 27 73 |me of the file's| 000006e0 20 6c 65 61 66 6e 61 6d 65 20 28 74 68 65 20 62 | leafname (the b| 000006f0 69 74 20 61 66 74 65 72 20 74 68 65 20 6c 61 73 |it after the las| 00000700 74 20 64 6f 74 20 69 6e 20 74 68 65 0a 66 69 6c |t dot in the.fil| 00000710 65 6e 61 6d 65 29 2e 20 20 43 6c 65 61 72 20 69 |ename). Clear i| 00000720 73 20 6f 6e 6c 79 20 75 73 65 64 20 66 6f 72 20 |s only used for | 00000730 32 34 62 70 70 20 69 6d 61 67 65 73 2c 20 69 74 |24bpp images, it| 00000740 20 63 61 6e 20 62 65 20 64 69 73 70 6c 61 79 65 | can be displaye| 00000750 64 20 75 73 69 6e 67 0a 54 72 61 6e 73 6c 61 74 |d using.Translat| 00000760 6f 72 2c 20 43 68 61 6e 67 65 46 53 49 2c 20 54 |or, ChangeFSI, T| 00000770 72 75 65 56 69 65 77 2c 20 43 6c 65 61 72 6c 79 |rueView, Clearly| 00000780 20 65 74 63 2e 20 20 41 67 61 69 6e 20 79 6f 75 | etc. Again you| 00000790 20 63 61 6e 20 70 75 74 20 74 68 65 20 69 6d 61 | can put the ima| 000007a0 67 65 0a 74 68 72 6f 75 67 68 20 54 72 61 6e 73 |ge.through Trans| 000007b0 6c 61 74 6f 72 20 6f 72 20 43 68 61 6e 67 65 46 |lator or ChangeF| 000007c0 53 49 20 74 6f 20 74 75 72 6e 20 69 74 20 69 6e |SI to turn it in| 000007d0 74 6f 20 61 20 53 70 72 69 74 65 2e 0a 0a 20 4f |to a Sprite... O| 000007e0 6e 65 20 6f 66 20 74 68 65 20 72 65 61 73 6f 6e |ne of the reason| 000007f0 73 20 77 68 79 20 49 20 77 72 6f 74 65 20 74 68 |s why I wrote th| 00000800 69 73 20 70 72 6f 67 72 61 6d 20 69 73 20 74 68 |is program is th| 00000810 61 74 20 54 72 61 6e 73 6c 61 74 6f 72 20 61 6e |at Translator an| 00000820 64 0a 43 68 61 6e 67 65 46 53 49 20 68 61 76 65 |d.ChangeFSI have| 00000830 20 70 72 6f 62 6c 65 6d 73 20 77 68 65 6e 20 72 | problems when r| 00000840 65 61 64 69 6e 67 20 63 65 72 74 61 69 6e 20 42 |eading certain B| 00000850 4d 50 73 2c 20 61 73 20 74 68 65 79 20 69 6e 63 |MPs, as they inc| 00000860 6f 72 72 65 63 74 6c 79 0a 63 61 6c 63 75 6c 61 |orrectly.calcula| 00000870 74 65 20 74 68 65 20 77 6f 72 64 2d 61 6c 69 67 |te the word-alig| 00000880 6e 65 64 20 6c 69 6e 65 20 6c 65 6e 67 74 68 73 |ned line lengths| 00000890 2c 20 74 75 74 20 74 75 74 21 0a 0a 20 57 68 65 |, tut tut!.. Whe| 000008a0 6e 20 77 72 69 74 69 6e 67 20 6f 75 74 20 61 20 |n writing out a | 000008b0 53 70 72 69 74 65 2c 20 74 68 65 20 6d 6f 64 65 |Sprite, the mode| 000008c0 20 69 74 20 69 73 20 67 69 76 65 6e 20 77 69 6c | it is given wil| 000008d0 6c 20 62 65 20 65 69 74 68 65 72 2c 20 32 35 2c |l be either, 25,| 000008e0 20 32 37 20 6f 72 0a 32 38 2e 0a | 27 or.28..| 000008eb
.