Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:06 25 Nov 2024 Privacy Policy
Jump to

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: Australia
Posts: 512
Posted: 06:27am 13 Jan 2012
Copy link to clipboard 
Print this post

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: Australia
Posts: 512
Posted: 09:37am 13 Jan 2012
Copy link to clipboard 
Print this post

Does anyone know the BMP format of files created on the MM with SAVEBMP?
 
BobDevries

Senior Member

Joined: 08/06/2011
Location: Australia
Posts: 266
Posted: 09:47am 13 Jan 2012
Copy link to clipboard 
Print this post

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: Australia
Posts: 164
Posted: 10:08am 13 Jan 2012
Copy link to clipboard 
Print this post

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. Edited by crackerjack 2012-01-14
 
brucepython

Regular Member

Joined: 19/06/2011
Location: Australia
Posts: 64
Posted: 11:23pm 13 Jan 2012
Copy link to clipboard 
Print this post

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. Edited by brucepython 2012-01-15
 
Nick

Guru

Joined: 09/06/2011
Location: Australia
Posts: 512
Posted: 07:51pm 14 Jan 2012
Copy link to clipboard 
Print this post

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: Australia
Posts: 64
Posted: 07:57pm 14 Jan 2012
Copy link to clipboard 
Print this post

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: Australia
Posts: 512
Posted: 09:20pm 14 Jan 2012
Copy link to clipboard 
Print this post


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: Australia
Posts: 64
Posted: 09:42pm 14 Jan 2012
Copy link to clipboard 
Print this post

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


To reply to this topic, you need to log in.

© JAQ Software 2024