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.

DarkBASIC Professional Discussion / save bitmap in dbpro

Author
Message
Morcilla
23
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 12th Apr 2003 22:33
Hi there,

it's known that 'SAVE BITMAP' command is now obsolete.

I have been looking around and the only solution I've seen posted is one from Raven on 25th feb:

http://www.darkbasicpro.com/apollo/view.php?t=6408&b=6

I have to say that I have not been able to run it properly, the memblock runs out of space, and other problems... Making the output file unreadable from windows.

Has anyone tried it with better luck than me?
Raven are you there? :o)

Thanks in advance

P.D.: I think it's uncredible that they took out the command, c'mon, the more commands, the better ¿was it that hard? .still happy.
CloseToPerfect
23
Years of Service
User Offline
Joined: 20th Dec 2002
Location: United States
Posted: 13th Apr 2003 01:15
They will inculde new unbosolete commands around patch 11 or was it 12, anyway it will get there.

Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 13th Apr 2003 02:49
There is a DLL available that will do this.

Get it from RGT forums: http://www.realgametools.net/forums

Current Project: Retro Compo. Entry.
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 13th Apr 2003 03:58
Or here is a memblock free version:

Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 13th Apr 2003 07:07
[i'm sorry but the Raven you have called is not at home right now but if you'd like to leave a message then please wait for the beep. if you'd like a human operator to answer please hold the line for 2-18hours... all calls will be charged at $1.50/minute. Raven would like to thank you for your patience]
BEEEP!

Ian's is a good one never tested the one i posted last time, just sat there and typed it up in a min - thats what i get for working from the top of my head.
but should really be learning from what code you're given, working would be nice lol but sometimes its better when it doesn't so you can figure out whats wrong to fixx it and learn in the process

i think next time though i'll atleast run it through the compiler once.

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
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 13th Apr 2003 09:54
oki well i'm in at the moment on the laptop, having my 6th beer of the nite ... i think i'm starting to get nicely sloshed
and i'm going back outside in a sec to train some more cause it is just such a perfect evening (^_^)

well anyways i got a lil bored just now, extended Ian's code, now you can save the screen, image or bitmap to a 24bit v3 bitmap
now before you ask, nope not tested - but should work as it is literally just a simple extention.
(that is provided Ian's works lol)

oh i've been getting used to using a global set of variables i'm using as a pointer system so that i can just add on instances of things to the end ... it allows me to use a tally at the end of each program so i can release everything. I know Pro does this already but it helps a few other things too.

for this example i've included all you need

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
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 13th Apr 2003 09:59
just checked the code... the yellow line and the other two lines that follow should read



god knows what happened

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?
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 13th Apr 2003 13:23
My code *was* a bit mixed up on screen/bitmaps - it would work only if the bitmap you wanted to save was the screen bitmap - ah well, it was a long night

Still, a few simple changes and now it works properly.
Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 13th Apr 2003 15:38 Edited at: 13th Apr 2003 15:43
Anyone up for writting a save as .jpg with the quality setting?

Now that'd be a challenge.

EDIT: Um, not to worry http://www.realgametools.net/forums/index.php?board=28;action=display;threadid=7151

Pneumatic Dryll, Outrageous epic cleric of EQ/Xev
God made the world in 7 days, but we're still waiting for the patch.
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 13th Apr 2003 21:39
lol... depends which kind of encoding you want Pneu - it's easier achieveing it within C/C++ than it is within DarkBasic thou.

i noticed that no ones done a PNG/PCX/TGA/DDS one - perhaps i could do that as they're good formats

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?
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 19th Apr 2003 13:42
Now I've been using my code in anger, I found a problem - sometimes the bitmap doesn't load back quite right. I've now found out that each row of pixels written must be padded to a multiple of 4 bytes in size.

Here is the fixed code
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 21st Apr 2003 03:31
guess windows is the using the Quad RGB rather than Tri RGB -

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?
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 21st Apr 2003 13:10
Nope - it does use 3 bytes per colour, but insists on each line being padded.
Morcilla
23
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 22nd Apr 2003 13:12
Well thanks a lot!
I was on vacation and I'm testing it now.

Login to post a reply

Server time is: 2026-07-11 06:07:10
Your offset time is: 2026-07-11 06:07:10