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.

AppGameKit Classic Chat / CopyImage possible bug

Author
Message
XANAX 2B
21
Years of Service
User Offline
Joined: 20th Jun 2003
Location: Corsica (France)
Posted: 26th May 2016 03:53
Hello

When i use CopyImage with SetDisplayAspect set to -1, there is a scale problem under Windows.

My Freewares here : http://www.retro-bruno.com
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 26th May 2016 20:38
The problem is in GetImage, when you ask it to take an image of 800x600, this is worked out using the virtual resolution, and since your virtual resolution is 800x600 it is telling AppGameKit to take an image of the entire screen. However the window is 1024x768, so the back buffer is 1024x768, so an image of the entire screen is 1024x768 pixels in size. You correctly account for this by using SetSpriteSize(1,800,600) so the sprite that uses it will be sized correctly, but when using CopyImage it looks at the image size, so 800x600 is only sampling part of the image. You can work around this by doing CopyImage(2, 1, 0, 0, GetImageWidth(1), GetImageHeight(1)) instead.
XANAX 2B
21
Years of Service
User Offline
Joined: 20th Jun 2003
Location: Corsica (France)
Posted: 27th May 2016 22:39
Thanks
My Freewares here : http://www.retro-bruno.com
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 28th May 2016 10:42
For images I generate before the start of the game I simplify things. I set the resolution to the device dimensions, and then I don't need to consider any conversions, stretching, resizing etc.
Afterwards, I set my actual dimensions.

Of course this is much harder if you need to do during gameplay.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt

Login to post a reply

Server time is: 2024-11-25 05:27:18
Your offset time is: 2024-11-25 05:27:18