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 Discussion / image to db code converter

Author
Message
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 4th Jul 2008 21:17 Edited at: 4th Jul 2008 23:58
Hey guys!

If you are active in the dbc challenge thread, you may need this, because you are not allowed to include any media such as images.

Anyway, I attached an exe, and here is the code:



How to use:

execute the program.
it will ask you for a file to load. That file HAS to be in the same directory as the program. Type in the name of the image file and the extension (.bmp/.jpg/.png)

Then it will ask for the width and the height. It must not exceed the bitmap size.

Once that is done, you will get an estimated time, how long it will take (64*64 is about 3 minutes, because the stupid "point()" command is too slow, so don`t make your image too big). Press Enter to start.

While this is processing, you can minimize the program, and it will still run, meaning, you can carry on with your code.

It will save the image to a file in the same directory called "imageout.dba"

When finished, you can simply copy the code inside that file, and paste it at the bottom of your program.


Now, to load your image, use this code:



I would greatly appreciate some better, more developed code to speed this process up.

Hope it helps!

TheComet

Oooooops!!! I accidentally formated drive c.
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 10th Jul 2008 20:25
Well, I just heard it`s no allowed to use data statements in the DBC challenge thread...

sinisterstuf
19
Years of Service
User Offline
Joined: 28th Mar 2007
Location: Namibia, Southern Africa
Posted: 12th Jul 2008 11:28
This is cool. Even though it isn't allowed in the challenge it would be great for other stuff and if I use it then I will be sure to credit you, thanks. And if you like I have some code to share, it's code for selecting a file to load visualy, i.e., instead of typing the name, it gives you a real time list of files in a specified directory and you just click one. This means no mistakes when typing the filename

Well... No, my name IS actually 'sinisterstuf' not 'Sinister Stuff', a misspelling resulting from the former having too many characters with no spaces in between

thanks CattleRustler!
Sinani201
19
Years of Service
User Offline
Joined: 16th Apr 2007
Location: Aperture Science Enrichment Center
Posted: 12th Jul 2008 23:49
Umm... why don't you just use TDK's file uploader so the picture can be in any directory? Just a thought.


TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 13th Jul 2008 19:01
Quote: "And if you like I have some code to share, it's code for selecting a file to load visualy, i.e., instead of typing the name, it gives you a real time list of files in a specified directory and you just click one. This means no mistakes when typing the filename "


Aw, I have that already, thanks for offering, though. I just made this simple program(I mean VERY simple program) for my last challenge entry, because I didn`t wan`t to write the data statements on my own.

Quote: "Umm... why don't you just use TDK's file uploader so the picture can be in any directory? Just a thought."


I`ll put that in, just leave me a day or 2.

TheComet

Login to post a reply

Server time is: 2026-07-05 07:07:08
Your offset time is: 2026-07-05 07:07:08