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 / DBC not recognizing Command: Set current bitmap

Author
Message
Caleb1994
17
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 9th Mar 2009 03:34
ok well i'm redoing my map editor and it was telling me bitmap to small to get image (idk why) so i tried making a large 2nd bitmap and using set current bitmap(should fix it and get a little farther so i can see wats going wrong) but its telling me unknown command and the syntax highlighting is highlighting it so its spelled correctly. it did this before but stopped any ideas?
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 9th Mar 2009 03:58
what's the code look like?

Enjoy your day.
Caleb1994
17
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 9th Mar 2009 04:14


if you want the rest tell me but this is where its giving problems
BN2 Productions
22
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 9th Mar 2009 08:21
Bitmap too small to get image means you are trying to get an image that is larger than the bitmaps size (not a problem on bitmap 0, but only on others).

This is the most LIKELY reason:

You created a bitmap, lets say, at 640x480

You then tried to grab the screen by 0,0,640,480

The problem is that 640 is number of pixels wide, and if it starts counting from 0, then to get 640 pixels, it has to be from 0 to 639 (get it?)

That is my guess, though I haven't looked into the code much yet.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 9th Mar 2009 08:23 Edited at: 9th Mar 2009 08:27
[EDIT] BN2 beat me to it!

[ORIGINAL]
How big is the Tiles1.bmp? You may be over reaching unwittingly.

An alternative to loading the image and turning it into a sprite might be:



Enjoy your day.
Caleb1994
17
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 9th Mar 2009 15:09 Edited at: 9th Mar 2009 15:35
BN2:

It was giving a bitmap to small to get image before i made another bitmap. and you can still get that error with bitmap 0 can't you?
bitmap 0 is the size of the screen (640,480) so if its bigger then that you with run into the problem of bitmap to small to get image won't you? thats why i don't know why i'm getting this error. the image isn't that big

but i see what you mean


Latch:

interesting idea i forgot about load bitmap lol. the image is 128 by 96 so it shouldn't be making this error lol its 32X32 tiles 4X3 lol thats why i was trying to get past it and find the error in the calculations.

although i don't know why its that size as 32*4 is 136 and 32*3 is 102 hmmmm i made it in paint heres the image.

i will try that though latch thanks to both of you
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 9th Mar 2009 19:05
Your loops reached beyond the size of the bitmap. If you check the code I supplied, I reduced the size of your loops. You loops were 1 unit too long. If your tile ratio is 4x3, because you start counting from 0, then rows should be 3-1 and columns should be 4-1



Enjoy your day.
Caleb1994
17
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 9th Mar 2009 22:54
ok i will try that thank you

Login to post a reply

Server time is: 2026-07-04 22:12:46
Your offset time is: 2026-07-04 22:12:46