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 / GET IMAGE still gives error

Author
Message
Rodro
21
Years of Service
User Offline
Joined: 17th Sep 2002
Location:
Posted: 22nd Oct 2002 04:04
"GET IMAGE is no longer restricted to the size of the default screen"

I think still doesn't work. Although, it might by problem, however, I can't tell because the debugger crashes everytime I "watch variables" I also try PRINT statements but I see nothing.

PATCH 2 told me everything installed correctly.

Hey!! You talking to me?
Richard Davey
Retired Moderator
21
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 22nd Oct 2002 04:44
Sync before you wait key because I'm guessing you've got sync on somewhere at the top of your code. Also "print str$(left)" would be more useful. Impossible to tell if your code is at fault because that isn't nearly enough code to go on - what are the starting values? Where is the source image (what dimensions is it), etc.

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
Rodro
21
Years of Service
User Offline
Joined: 17th Sep 2002
Location:
Posted: 22nd Oct 2002 05:18
Yeah, sorry -- feel stupid!

There is no sync on before

The image is 145x680

cardwidth = 31
cardheight = 53
cardnumber = 0
maxsuits = 4
maxranks = 13

cls
rem remstart
LOAD BITMAP "deck.bmp",1
rem CREATE BITMAP 2,500,2000
rem COPY BITMAP 1,2
SET CURRENT BITMAP 1
ed = bitmap height(1)
FOR i=1 TO maxsuits
FOR j=1 TO maxranks
INC cardnumber
right = (i*cardwidth)-1
bottom = (j*cardheight)-1
top = ((j-1)*cardheight)
left = ((i-1)*cardwidth)
print left
print top
print right
print bottom
wait key
GET IMAGE cardnumber, left, top, right, bottom
NEXT j
NEXT i
SET CURRENT BITMAP 0

Hey!! You talking to me?
Rodro
21
Years of Service
User Offline
Joined: 17th Sep 2002
Location:
Posted: 22nd Oct 2002 05:19
Here it is formatted:



Hey!! You talking to me?
Richard Davey
Retired Moderator
21
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 23rd Oct 2002 04:19
I would print out the "cardnumber" in your main loop and watch it to see how far it gets. At what coordinates on get image does it go belly-up?

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
Rodro
21
Years of Service
User Offline
Joined: 17th Sep 2002
Location:
Posted: 23rd Oct 2002 06:02
I added print "cardnumbeer ";str$(cardnumber)



I do not see the print statement when I run.

Thanks.

Hey!! You talking to me?
Rodro
21
Years of Service
User Offline
Joined: 17th Sep 2002
Location:
Posted: 23rd Oct 2002 07:06
When change maxranks = 12 it works. Does that make sense?

Hey!! You talking to me?
dARKNER
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: Sweden
Posted: 23rd Oct 2002 12:54
I think its quite logic ..

FOR j=1 TO maxranks ; J Can be up to 13 aih -..

bottom = (j*cardheight)-1
Alas: Bottom = (13 * 53 ) - 1
Bottom = 688

-> The image is 145x680

There's Yr error ..

//dARKNER
Richard Davey
Retired Moderator
21
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 23rd Oct 2002 16:39
Indeed.. additionally I'd like to add that the reason the "print" command isn't working is because you've got the bitmap currently set to 1 (which is an off-screen location), you need to "set current bitmap 0" before the print command and sync then switch back again afterwards. Messy, but it works.

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
Rodro
21
Years of Service
User Offline
Joined: 17th Sep 2002
Location:
Posted: 24th Oct 2002 04:17
Thanks a lot!! it was driving me crazy!!

Hey!! You talking to me?

Login to post a reply

Server time is: 2024-04-25 09:36:46
Your offset time is: 2024-04-25 09:36:46