Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : LOADBMP (Loading a BMP)
Author | Message | ||||
Nick Guru Joined: 09/06/2011 Location: AustraliaPosts: 512 |
A suggestion for the MM Basic 3.1... We can currently save a BMP image with SAVEBMP. How about we also be able to do the reverse and load a BMP with LOADBMP? Nick |
||||
Nick Guru Joined: 09/06/2011 Location: AustraliaPosts: 512 |
Does anyone know the BMP format of files created on the MM with SAVEBMP? |
||||
BobDevries Senior Member Joined: 08/06/2011 Location: AustraliaPosts: 266 |
Nick, they look to be standard bitmap files as used in windows. I have some stored on my Windows machine, and they are 480 x 432, and can be viewed with the standard windows picture viewer. Regards, Bob Devries Dalby, QLD, Australia |
||||
crackerjack Senior Member Joined: 11/07/2011 Location: AustraliaPosts: 164 |
I posted some code back in October to load bitmaps. See here. It's not firmware, only a couple of programs to make it pretty easy to do. |
||||
brucepython Regular Member Joined: 19/06/2011 Location: AustraliaPosts: 64 |
There's also SHOWBMP.BAS, which is available in Geoff's MMBasic Library V1.6 . It's in BASIC so it's not very fast (tho' much quicker now with OS 2.7 and later). It's commented so that it gives an idea of how the 1-bit BMP format is unravelled. More info on this is available from many sites, including the Wikipedia entry for "BMP". It would sometimes be useful to have a BMP unpacking routine done in compiled code and included in the OS, but it's not really a do-or-die requirement. Bruce PS I've added a version specifically for OS V3.x. Download here. The ZIP file also contains a few 1-bit BMP images for test purposes. |
||||
Nick Guru Joined: 09/06/2011 Location: AustraliaPosts: 512 |
Downloaded and tried it. Very good. Program works a charm. I have an idea for something and needed a way to load an image into the MM. This program is a useful tool. Good job Bruce! |
||||
brucepython Regular Member Joined: 19/06/2011 Location: AustraliaPosts: 64 |
Thanks Nick, If you're loading an image into a program (to provide a background, logo or whatever) then Crackerjack's approach is the way to go. It's very fast at displaying images because they are pre-processed into an RLE format which unpacks almost instantly. Bruce |
||||
Nick Guru Joined: 09/06/2011 Location: AustraliaPosts: 512 |
For what I'm doing at the moment, I need to keep the image as a BMP and not converted. You're program is working fine. It inverts everything but I can work around that. |
||||
brucepython Regular Member Joined: 19/06/2011 Location: AustraliaPosts: 64 |
To prevent inverting just remove the NOT in the third last line so it reads: Pixel(x+7-bit)=byte AND b(bit) Bruce |
||||
Print this page |