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 / Bitmap region error

Author
Message
Tamandt
20
Years of Service
User Offline
Joined: 23rd Dec 2004
Location:
Posted: 24th Dec 2004 02:16
Basically im trying to copy 32x32 tiles into a blank bitmap
Then copy that bitmap to the screen.

I get the error "region cannot exceed bitmap size"

can you help.
Tamandt
20
Years of Service
User Offline
Joined: 23rd Dec 2004
Location:
Posted: 24th Dec 2004 02:37
Huh, my code didnt post, so here it is

OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 24th Dec 2004 02:41
You have to be careful as the created size is (x-1)x(y-1), so its quite possible a pixel each way is exceeding the bitmap size.

Try Create Bitmap 3,641,481

Beware the cat... The alien... The heretic...
Tamandt
20
Years of Service
User Offline
Joined: 23rd Dec 2004
Location:
Posted: 24th Dec 2004 02:44
Doing that causes "Source bitmap too large" error

But let me understand this,if i create a bitmap of 100x100 its actually only 99x99?
Tamandt
20
Years of Service
User Offline
Joined: 23rd Dec 2004
Location:
Posted: 24th Dec 2004 02:47
One further note, using your suggestion of creating the image as 641x481 and using this:

copy bitmap 3,0,0,640,480,0,0,0,640,480

I still get the region error,
Tamandt
20
Years of Service
User Offline
Joined: 23rd Dec 2004
Location:
Posted: 24th Dec 2004 03:10
God i love you guys. Ok it did have to do with the -1 thing.
Creating the image of 640x480 does create a 640x480 image, but from what I now understand is.

0-639x0-479

and my actual problem was i was trying to copy a 32x32 tile
as 0,0,32,32 which it should have been 0,0,31,31. While this makes sence to me as a programmer I took my example from the runner demo and it does not use -1. Why it works i dunno. I also had a sprite of a walking character i did myself without using -1, which worked too. I corrected it now.

So im not sure why it worked on the sprite end and not the bitmap end. Maybe Get Image dymanically resizes? who knows. Thanks though, everything works now,

Login to post a reply

Server time is: 2025-06-07 09:44:10
Your offset time is: 2025-06-07 09:44:10