Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Future Improvements (https://forums.graalonline.com/forums/forumdisplay.php?f=10)
-   -   getpixel() (https://forums.graalonline.com/forums/showthread.php?t=79769)

Tigairius 05-18-2008 05:33 PM

getpixel()
 
Could there be a get pixel function? like

PHP Code:

getpixel(objscreenxscreeny

Example:
getpixel("GraalControl", mousescreenx, mousescreeny);

It would make my life a whole lot easier, I don't know how easy this would be to implement but it seriously needs doing please.

cbk1994 05-18-2008 05:54 PM

This should be extremely easy I would think.

I mean, they even do this kind of thing in Paint.

If nothing else, you could take a screenshot and then use getPixelOnImage() or whatever it is.

Tigairius 05-18-2008 06:09 PM

Quote:

Originally Posted by cbk1994 (Post 1391411)
This should be extremely easy I would think.

I mean, they even do this kind of thing in Paint.

If nothing else, you could take a screenshot and then use getPixelOnImage() or whatever it is.

Yeah, but that would be pretty inefficient imo, having to save a screenshot on the client's computer and then getimgpixel on it...

DustyPorViva 05-18-2008 06:16 PM

Well there's already a getpixel function that I listed in your other thread? Or is this specifically about getting pixel information from an object?

edit: scratch that, I forgot the current function gets it from an image.

cbk1994 05-18-2008 06:19 PM

Quote:

Originally Posted by Tigairius (Post 1391412)
Yeah, but that would be pretty inefficient imo, having to save a screenshot on the client's computer and then getimgpixel on it...

I know, but it's better than nothing I guess.

Robin 05-18-2008 06:31 PM

Probably better if it was a getRect(x,y,w,h) function otherwise it would slow things down tremendously

Tigairius 05-18-2008 09:07 PM

Quote:

Originally Posted by Robin (Post 1391415)
Probably better if it was a getRect(x,y,w,h) function otherwise it would slow things down tremendously

Good idea, getpixelrect(x, y, w, h) or something :( I really need it though.

Admins 05-19-2008 12:58 AM

Such a function would be complex for OpenGL/DirectX (taking a screenshot, getting the pixel from that), so it's not planned to be added anytime soon. It would however be simple for the new external windows.

Tigairius 05-19-2008 01:11 AM

Quote:

Originally Posted by Stefan (Post 1391473)
Such a function would be complex for OpenGL/DirectX (taking a screenshot, getting the pixel from that), so it's not planned to be added anytime soon. It would however be simple for the new external windows.

Try to add that in to the external windows :D

cbk1994 05-19-2008 01:34 AM

Quote:

Originally Posted by Stefan (Post 1391473)
Such a function would be complex for OpenGL/DirectX (taking a screenshot, getting the pixel from that), so it's not planned to be added anytime soon. It would however be simple for the new external windows.

Would you really need to take a screenshot? That was just an example of a bad way it could be done. I would think it would be better to do it however other programs do it. I'm guessing each operating system has some way to do it as well?

Robin 05-19-2008 01:44 AM

Quote:

Originally Posted by Stefan (Post 1391473)
Such a function would be complex for OpenGL/DirectX (taking a screenshot, getting the pixel from that), so it's not planned to be added anytime soon. It would however be simple for the new external windows.

Surely you should be able to reference a rect from the surface? (At least on DirectX?)

But yeah it's probably much easier to do with the GDI on windows, but on OS X?

cbk1994 05-19-2008 02:55 AM

Quote:

Originally Posted by Robin (Post 1391493)
Surely you should be able to reference a rect from the surface? (At least on DirectX?)

But yeah it's probably much easier to do with the GDI on windows, but on OS X?

There are programs that do it in real time (for example, Fireworks) on OS X.

I'm sure operating systems must have some library or something to do this.

Robin 05-19-2008 02:57 AM

Quote:

Originally Posted by cbk1994 (Post 1391503)
There are programs that do it in real time (for example, Fireworks) on OS X.

I'm sure operating systems must have some library or something to do this.

Not quite the same thing we're talking about Chris.

cbk1994 05-19-2008 03:45 AM

Quote:

Originally Posted by Robin (Post 1391505)
Not quite the same thing we're talking about Chris.

From what I can understand, you need to get the color of a pixel at (x, y) on the screen?

Tigairius 05-19-2008 04:03 AM

Quote:

Originally Posted by cbk1994 (Post 1391511)
From what I can understand, you need to get the color of a pixel at (x, y) on the screen?

That's what I need, yes.

cbk1994 05-19-2008 05:50 AM

1 Attachment(s)
Fireworks does it (yes, it is selected by my mouse, but it gets hidden when you take a screenshot).

This makes me think it would be a system thing, as it can do it with anything on the screen, not just in that program.

Crow 05-19-2008 01:53 PM

1 Attachment(s)
Actually, theres a handy program I often use which zooms the few pixels around your mouse and gives color informations for the one exactly at your mouse. It can be used on your whole screen, so I guess it should be possible, somehow, without taking a screenshot, because this baby doesnt.
Attached it for the people interested.

cbk1994 05-20-2008 01:03 AM

1 Attachment(s)
I just remember this, there's also a tool built into Mac.


All times are GMT +2. The time now is 08:23 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.