473,396 Members | 1,805 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

pixel colour on screen

Could anyone help me, I'm a python noob and need some help. im trying
to find some code that will, given a screen co-ordinate, will give me
the colour of that pixel in RGB. i have found a lot about getting the
pixel colour from a picture file with a given co-ordinate, but is it
possible to do it from the whole screen output regardless what
application the selected pixel is in?

any help would be help.

thanks, Chris
Jun 28 '08 #1
4 3550

Dennis Lee Bieber wrote:
On Sat, 28 Jun 2008 11:47:46 -0700 (PDT), cj*******@hotmail.com
declaimed the following in comp.lang.python:
>Could anyone help me, I'm a python noob and need some help. im trying
to find some code that will, given a screen co-ordinate, will give me
the colour of that pixel in RGB. i have found a lot about getting the
pixel colour from a picture file with a given co-ordinate, but is it
possible to do it from the whole screen output regardless what
application the selected pixel is in?
Such capability differs with OS and GUI libraries. If one is lucky,
the GUI library will accept any screen coordinate -- but it is just as
likely that the OS could limit a program to only coordinates within its
own window.
Maybe the easiest way is to create a screenshot of the whole screen
(that should be doable from within a program, although this differs for every OS and GUI
lib as well) and then get the pixel value from that.

--irmen
Jun 29 '08 #2
cj*******@hotmail.com wrote:
>
Could anyone help me, I'm a python noob and need some help. im trying
to find some code that will, given a screen co-ordinate, will give me
the colour of that pixel in RGB. i have found a lot about getting the
pixel colour from a picture file with a given co-ordinate, but is it
possible to do it from the whole screen output regardless what
application the selected pixel is in?
Which operating system? If you are on Windows, and you have pywin32
loaded. you can use the Windows APIs GetDC and GetPixel.
--
Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Jun 30 '08 #3
On Jun 30, 4:37*am, Tim Roberts <t...@probo.comwrote:
cjstut...@hotmail.com wrote:
Could anyone help me, I'm a python noob and need some help. im trying
to find some code that will, given ascreenco-ordinate, will give me
thecolourof thatpixelin RGB. i have found a lot about getting the
pixelcolourfrom a picture file with a given co-ordinate, but is it
possible to do it from the wholescreenoutput regardless what
application the selectedpixelis in?

Which operating system? *If you are on Windows, and you have pywin32
loaded. you can use the Windows APIs GetDC and GetPixel.
--
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.
i have ubuntu hardy. does that help?
Jul 26 '08 #4
chris <cj*******@hotmail.comwrote:
>On Jun 30, 4:37*am, Tim Roberts <t...@probo.comwrote:
>cjstut...@hotmail.com wrote:
>Could anyone help me, I'm a python noob and need some help. im trying
to find some code that will, given ascreenco-ordinate, will give me
thecolourof thatpixelin RGB. i have found a lot about getting the
pixelcolourfrom a picture file with a given co-ordinate, but is it
possible to do it from the wholescreenoutput regardless what
application the selectedpixelis in?

Which operating system? *If you are on Windows, and you have pywin32
loaded. you can use the Windows APIs GetDC and GetPixel.

i have ubuntu hardy. does that help?
Then you will have to use a GUI library of some kind: wx, or Qt, or
tkinter. The answer depends on which GUI library you decide to use.
--
Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Jul 27 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Derek Scollon | last post by:
I'm using PHP4.2.2 with gd on a Linux platform and am having difficulty in solving a little problem despite going through the definitions of the various image functions. If you load a...
4
by: grogerteal | last post by:
Hello, I am pretty new to programming and would like someone to help me get started on the program that I need to make. I hope it is not hard to do, but what I would like is a simple app that...
3
by: Mark Ingram | last post by:
Hi, ive got an imagine in a PictureBox, and would like to get the colour of the pixel when the mouse is over the control. From what ive (briefly) seen, there is no way to do this directly in C# and...
6
by: Hooyoo | last post by:
I want to get the color of the specified pixel in the screen. Firstly I get the position of the cursor: //Get the position of cursor. Point position = Cursor.Position; Next I want to get the...
20
by: Chor Lit | last post by:
Hi, I asked Bjarne Stroustrup about the idea of adding colour standard for C++, and he said that it is very difficult for compiler vendors to change their IDE. But do you think it is possible ? ...
4
by: Johny | last post by:
I use PIL to write some text to a picture.The text must be seen wery clearly. I write the text to different pictures but to the same position. As pictures maybe different, colour, in the...
2
by: kuratkull | last post by:
Hello, I haven't asked If I wasn't really confused :) OK, so I am just beginning SDL programming in C, and I was running fine, until I tried getting a pixel colour. Basically, I am trying to...
8
by: =?Utf-8?B?S2Vsdmlu?= | last post by:
Hi all, I am writing an application to detect the dead pixel of LCD panel by using visual C++ (MFC). My flow is follow: 1. Display a dialog with a start button. When the user press the start...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.