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.

Bug Reports / [DGDK] Distorted screenshot

Author
Message
Mireben
15
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 27th Feb 2010 14:01 Edited at: 27th Feb 2010 14:27
I tried to save a screenshot of my application with dbGetImage and dbSaveImage. Whatever I set the display resolution to, the number of pixels in the resulting image does not correspond to the screen resolution and so the aspect ratio will be distorted.

I even tried to copy the screen bitmap to another bitmap first and then get the image from that bitmap. The bitmap size is still OK but as soon as I use GetImage, the image is distorted. Project is attached to reproduce the problem.

(EDIT: as a workaround, I tried to save the copied bitmap to disk, but that does not work either. I opened another thread for that problem.)

Attachments

Login to view attachments
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 28th Feb 2010 00:12
This one is not a bug.

There are two versions of dbGetImage - one has 5 parameters (the one you are using) and stretches the dimensions of the image it creates to the next higher power-of-2 (so 640 becomes 1024 and 480 becomes 512). Doing this (on older cards at least) makes using those textures more efficient during rendering.

The other version (the one with 6 parameters) allows you to determine whether that stretching takes place or not. If you set the last value to 0, stretching will still occur. If you set it to 1 then it will not.

Change your code and add an extra ',1' as the last parameter of your dbGetImage, and you'll see that it works.

Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 1st Mar 2010 11:49 Edited at: 1st Mar 2010 11:50
Quote: "Change your code and add an extra ',1' as the last parameter of your dbGetImage, and you'll see that it works."

Yes, you can try these lines:



Login to post a reply

Server time is: 2024-04-19 12:34:54
Your offset time is: 2024-04-19 12:34:54