BBC BASIC for Windows
« how do I load and save a bmp image? »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 9:53pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: how do I load and save a bmp image?  (Read 581 times)
michael
Senior Member
ImageImageImageImage


member is offline

Avatar




PM


Posts: 335
question how do I load and save a bmp image?
« Thread started on: Apr 21st, 2016, 03:49am »

In order to make my next app.. BMPTOCODE for BBC Basic I need to know how to load a bmp image (255) color BMP and then I can read the information and compress it so small that it only occupies a few lines of code.
Can I get assistance with this?
User IP Logged

I like making program generators and like reinventing the wheel
DDRM
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 321
question Re: how do I load and save a bmp image?
« Reply #1 on: Apr 21st, 2016, 08:09am »

Hi Michael,

You can use *LOAD to load a file into memory: you'll need to reserve space first using DIM.

Since it's a bitmap, you might consider making a DIBSection for the screen, as has been used in several recent posts, and then using *DISPLAY to load the bitmap into it: that way you'd automatically get a pointer to the start of the image data.

I'm looking forward to seeing how you compress the image data into a program!

smiley

D
User IP Logged

hellomike
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 46
question Re: how do I load and save a bmp image?
« Reply #2 on: Apr 21st, 2016, 08:19am »

Michael,

There is example code in the manual!
See: http://www.bbcbasic.co.uk/bbcwin/manual/bbcwine.html#gifjpeg

Note that Quote:
This routine will also display Windows Bitmap (.BMP or .ICO) and Windows Metafile (.WMF or .EMF) images.


Please show us the result when it works.

Good luck.

Mike
User IP Logged

michael
Senior Member
ImageImageImageImage


member is offline

Avatar




PM


Posts: 335
cheesy Re: how do I load and save a bmp image?
« Reply #3 on: Apr 21st, 2016, 3:07pm »

Thanks a lot.
I do have a few products of BMPTOCODE in forums.
One is the Message box exclamation point called
"Looks like you have an error Notice Box"
and
"A sky full of rating stars"
Keep in mind that BMPTOCODE is meant for making images no larger than 100x100 and the image must not be too complex. (also the image MUST be the same width and height and you can only use the colors in paint that I specify)

(more complexity)= larger code

But that is from the modified version and would require
mostly a rebuild or BMPTOCODE (except for the compression technique)
« Last Edit: Apr 21st, 2016, 10:40pm by michael » User IP Logged

I like making program generators and like reinventing the wheel
Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls