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.

Dark GDK / Code that crashes.

Author
Message
Gravity 404
15
Years of Service
User Offline
Joined: 24th Dec 2008
Location:
Posted: 25th Dec 2008 00:26
I created what I thought was a simple program. I load a bitmap, turn it into an image, use the image to create a sprite. I rotate the sprite 45 degrees, then use getImage to try and paste it somewhere else having been rotated 45 degrees. Thing crashes though. here is the code:




Any help in solving this mystery would be great.

My end goal is simply to capture a picture from the screen and save it to a file using dbSaveImage.

Thank you
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 25th Dec 2008 06:33
Quote: "for ( int i = 1; i < 30; i++ )
dbDeleteSprite ( i );"


Why are you deleting sprites that don't exist? And you didn't delete image 2.

The main thing you need to do is learn to use the debugger and step through the code so you can find where the abend occurs.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
Gravity 404
15
Years of Service
User Offline
Joined: 24th Dec 2008
Location:
Posted: 25th Dec 2008 14:38
the dbDelete sprite has no affect on the program. If you replace it with the correct code it still crashes. As well as if you delete image 2.

I agree you need to step through with the debugger. I did use the debugger to step through and it crashes at the getimage line. The question is why? And more importantly how do you capture pixels from the screen. Typically you would use a function like getpixel, what is the equivalent Dark GDK function?

Thank you

Login to post a reply

Server time is: 2024-11-25 09:56:15
Your offset time is: 2024-11-25 09:56:15