Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / Save Bitmap

Author
Message
heartbone
21
Years of Service
User Offline
Joined: 9th Nov 2002
Location:
Posted: 24th Feb 2003 19:40
If you don't want to use DLLs try this:
Technically this code will "save the bitmap",
although it is of no use to anyone who doesn't use DBPro to read it.

To load it.

You could use Images instead of Bitmaps.
The more you see, the more you know.
The more you know, the more you see.
David T
Retired Moderator
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 24th Feb 2003 21:02
That's very clever, never thought of that before

Visit [url]www.lightning-systems.co.uk[/url]
You are the th person to view this signature.
CloseToPerfect
21
Years of Service
User Offline
Joined: 20th Dec 2002
Location: United States
Posted: 25th Feb 2003 05:41
thats is very clever, wished I'ld thought of it. lol
good job,
CTP

rapscaLLion
21
Years of Service
User Offline
Joined: 29th Aug 2002
Location: Canada
Posted: 25th Feb 2003 06:01
ROFL!!! I was contemplating learning the BMP file format and coding my own exporter... The answer is SO SIMPLE!

Alex Wanuch
aka rapscaLLion
Kousen Dev Progress >> Currently Working On Editors
heartbone
21
Years of Service
User Offline
Joined: 9th Nov 2002
Location:
Posted: 25th Feb 2003 08:27
Actually I didn't think that this would be of much use to anyone. I just posted it off the top of my head because I used the technique before and I didn't actually check the code till now after I saw the positive responses.

I made a mistake in the pseudo code to reload the image. The reload of the image won't work as I posted it.
The correct code uses a Read Memblock File_num,MB_num call instead of the Make Memblock From File function. The bitmap file creation code was OK.



Hope it didn't cause anybody problems.

The more you see, the more you know.
The more you know, the more you see.
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 25th Feb 2003 09:31
or you could use



for some reason my pro IDE doesn't recognise "make file from memblock" only "make file" - possibly a bug cause the function is still in the manual

from the info header see when i write from the previous memblock thats the Width and Height ... and then you have the bits per pixel - however you need to change that to 32

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 25th Feb 2003 09:32
just incase you don't know that will export to a readable 24bit Microsoft Windows Bitmap

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
heartbone
21
Years of Service
User Offline
Joined: 9th Nov 2002
Location:
Posted: 25th Feb 2003 17:20
Cool. A couple of compile bugs though.

You missed a comma,
write memblock byte memblock dwPos,0

open to write strBitmap,1
should be
open to write 1,strBitmap

I'll test it later. This is nice code as it's uncompiled.

On what page in the manual is that << function defined?
??= modulo remainder?

The more you see, the more you know.
The more you know, the more you see.
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 25th Feb 2003 18:23
Values and Operators

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
heartbone
21
Years of Service
User Offline
Joined: 9th Nov 2002
Location:
Posted: 25th Feb 2003 23:58
I don't have that page in my North American manual.
What is the operator's name and function?

The more you see, the more you know.
The more you know, the more you see.
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 26th Feb 2003 03:40
<< BitShift Left
>> BitShift Right

its in the online manual

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
heartbone
21
Years of Service
User Offline
Joined: 9th Nov 2002
Location:
Posted: 26th Feb 2003 06:41
ONLINE MANUAL?
There are mystery commands in a mystery online manual?


I see no mention of any online manual on this web site.

Just where is this mystery manual hidden?

The more you see, the more you know.
The more you know, the more you see.
indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 26th Feb 2003 06:47
did u mean this glossary at RGT?

http://www.realgametools.net/glossary/

Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 26th Feb 2003 07:23
no... just press F1

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 26th Feb 2003 07:58
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 26th Feb 2003 08:25
ya built-in i guess
i've always called the paper one the "manual" and the one packaged with DB the "online" one ... kinda figured others around here were too. Didn't know RGT had one actually online lol

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
Moggie100
21
Years of Service
User Offline
Joined: 15th Oct 2002
Location: Behind You...
Posted: 16th Mar 2003 01:30
Raven. why am I getting "Memblock range is illegal" when I try to run your code?
Also, am I using it correctly?

save_bitmap("Test.bmp",6400)

in this bit of code:



Thanks

IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 17th Mar 2003 20:38
Memblock numbers range from 1 to 256 - use a smaller number for your bitmap, or change Ravens code to us a specific memblock number.
Moggie100
21
Years of Service
User Offline
Joined: 15th Oct 2002
Location: Behind You...
Posted: 21st Mar 2003 17:30
oops! :-s thx!

Login to post a reply

Server time is: 2024-03-29 15:11:34
Your offset time is: 2024-03-29 15:11:34