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 / How to create a 5 pixel by 5 pixel Render Image when using SetDisplayAspect?

Author
Message
Polaraul
9
Years of Service
User Offline
Joined: 13th Dec 2014
Location:
Posted: 24th Jan 2015 17:24
Using SetDisplayAspect() I am trying to create a Render Image of 5 pixels by 5 pixels. Using the following code just crashes. Is there another way I should be doing this?


Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 24th Jan 2015 17:59
getdevicewidth is integer, try a float value

AGK 108 (B)19 + AppGameKit V2 Alpha .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Polaraul
9
Years of Service
User Offline
Joined: 13th Dec 2014
Location:
Posted: 24th Jan 2015 19:15
Many thanks Marcus. I just tried CreateRenderImage (1,5,5,0,0) to get my 5 pixel image. Perhaps CreateRenderImage() operates without respect for the SetDisplayAspect() setting.
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 24th Jan 2015 20:01
You can render to any image so if you like you can create an image of any size (even using GetImage) and use it as a render target.


Using AppGameKit V2 Tier 1
xCept
21
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 25th Jan 2015 07:54
Be weary of creating render images that are not multiples of 2, otherwise you may find it behaves quite bizarrely on various mobile devices (but desktop should be fine).
Polaraul
9
Years of Service
User Offline
Joined: 13th Dec 2014
Location:
Posted: 25th Jan 2015 13:12
@xCept Many thanks for the info. At present I am only developing for the desktop, so hopefully this should be okay.

Login to post a reply

Server time is: 2024-04-16 17:42:39
Your offset time is: 2024-04-16 17:42:39