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 / Capture screen question

Author
Message
Mishak
14
Years of Service
User Offline
Joined: 30th Oct 2009
Location:
Posted: 31st Oct 2009 19:48
Here is my second question:

I want to capture (and save as the image) some part of the screen.
Based on the command reference and my best understending, I am trying to do:


and nothing. No image that I could save later (to test I tried to show it later on screen using dbSprite ( 107, 400, 300, 8 ) call)

I wish developers could put more details into the function descriptions.
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 1st Nov 2009 02:03 Edited at: 1st Nov 2009 02:03
@Mishak
You are creating a new blank bitmap, and then getting an image from the blank bitmap. Of course the image will be blank.

To get a section of the screen, all you need is 'dbGetImage' and 'dbSaveImage', and 'dbDeleteImage' after you have saved it. NO OTHER COMMANDS!

Use 'dbGetImage' with the area of the screen you want to capture. Save this image to a file using 'dbSaveImage'. Once you have saved it you can delete it from memory with 'dbDeleteImage'.

Mishak
14
Years of Service
User Offline
Joined: 30th Oct 2009
Location:
Posted: 1st Nov 2009 04:35
Tried this one. Got error:
"tried to read a surface which has no read pemission".

From the Dark GDK reference info I see it as application is the owner of the screen. Specifically: "When you create a bitmap, it becomes the current bitmap. All drawing operations will be re-directed to the current bitmap and away from the screen. You can use the dbSetCurrentBitmap command to restore drawing operations to the screen."

So it looks like this is the only way to capture screen.
Did not work anyway.

Login to post a reply

Server time is: 2024-10-01 16:37:09
Your offset time is: 2024-10-01 16:37:09