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 / Is there any way of reading screen information directly?

Author
Message
Bloodwire
8
Years of Service
User Offline
Joined: 26th Dec 2015
Location:
Posted: 1st Jun 2016 00:41
Something along the lines of:
colour=GetPixel(x,y)

I find it peculiar that AppGameKit lacks this functionality, unless I have missed it? (I have searched for quite a bit.)
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 1st Jun 2016 07:32
in agk its possible to use GetImage( imageID, x, y, width, height ) or see SetRenderToImage ( colorImage, depthImage )
and then CreateMemblockFromImage
there you can get the rgb values, not the best way but it works.
from the backbuffer the alpha value is missing.

AGK (Steam) V2.0.18 : Windows 10 Pro 64 Bit : AMD (15.30.1025) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Bloodwire
8
Years of Service
User Offline
Joined: 26th Dec 2015
Location:
Posted: 1st Jun 2016 21:51
Thanks, this is what I ended up with (and it works):


Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 2nd Jun 2016 13:57 Edited at: 2nd Jun 2016 14:01
ok, but i see you not free the memblock. DeleteMemblock ( memID )
maybe also better use a fix image id. GetImage( imageID, x, y, width, height ) and maybe a static memblock too CreateMemblockFromImage( memID, imageID )
its also possible to make a color integer from it with MakeColor , read later with GetColorBlue ( color ) GetColorGreen ( color ) GetColorRed ( color )

if you use this systax you can generate this hex value in one row
rgb$=Right("0"+Hex(a),2) + Right("0"+Hex(b),2) + Right("0"+Hex(c),2)
AGK (Steam) V2.0.18 : Windows 10 Pro 64 Bit : AMD (15.30.1025) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)

Login to post a reply

Server time is: 2024-09-29 15:27:13
Your offset time is: 2024-09-29 15:27:13