-
September 27th, 2009, 02:55 PM
#1
A Coding Question
Could someone please explain to me how to get a pixel's color. I want to change this into C++ code, please:
If the color of this pixel is yellow
Then click here.
Thank you
-
September 28th, 2009, 01:25 AM
#2
Re: A Coding Question
The GetPixel API will get you the pixel color.
-
September 28th, 2009, 01:41 AM
#3
Re: A Coding Question
Where in GUI or on text-based interface?
-
September 28th, 2009, 10:46 PM
#4
Re: A Coding Question
Sorry I am aware of the basics of coding, but not with all the termenology. When you say a GUI or text based interface, I'm not sure what it means... but I'm using Visual C++ Express Edition. And when you say getPixel i understand its a function but I don' t know what API means. I was hoping that you could just tpye in the coding for me so I look at it and understand it, please.
Thank you.
-
September 28th, 2009, 10:48 PM
#5
Re: A Coding Question
How did you create the project?
Does it contain 'main' function or 'WinMain' function?
If it creates window (like this browser window), then it's GUI.
If it creates console window (command prompt type), then it's text-base (CUI)
-
September 28th, 2009, 10:50 PM
#6
Re: A Coding Question
I believe I will be using GUI, but I haven't started it yet, I would just like to know how to get a Pixel's color.
-
September 28th, 2009, 10:52 PM
#7
Re: A Coding Question
I believe I will be using GUI, but I haven't started it yet, I would just like to know how to get a Pixel's color
I am not concerned what you will be using. What are you using that interests me to answer your question appropriately.
But I don't see you stand for using the API (whichever), to get or set the color.
What your program does?
-
September 28th, 2009, 10:55 PM
#8
Re: A Coding Question
I'm not using a program right now. I'll be starting it once I understand how to get the pixel color. I just want to know how to get the pixel color using code in Visual C++ Express Edition. Is there a certain directory that I have to open up to get certain functions? Because I've learned how to do a mouse click just by surfing the web. Is this intensely difficult? or can it just be explained using a few lines of code?
-
September 29th, 2009, 12:12 AM
#9
Re: A Coding Question
Your question doesn't really make sense. That's why we're having trouble with it. Which window do you want to get a pixel from? If you don't have a program, then you can't have a window, so it doesn't really make sense to ask the question, now does it?
-
September 29th, 2009, 12:38 AM
#10
Re: A Coding Question
I'm not using a program right now. I'll be starting it once I understand how to get the pixel color. I just want to know how to get the pixel color using code in Visual C++ Express Edition
Let me ask you one question:
I want to know how to change from 5th gear to 4th gear, while riding/driving a vehicle. I will learn to drive vehicle only after I "know" how to change from 5th to 4th gear.
Please help me, otherwise I cannot start learn driving.
-
September 29th, 2009, 07:09 AM
#11
Re: A Coding Question
Originally Posted by IanTheShaf
I'm not using a program right now. I'll be starting it once I understand how to get the pixel color. I just want to know how to get the pixel color using code in Visual C++ Express Edition. Is there a certain directory that I have to open up to get certain functions? Because I've learned how to do a mouse click just by surfing the web. Is this intensely difficult? or can it just be explained using a few lines of code?
You've been given the answer already (at least based on the limited information provided). It seems like you're quite a long way from being able to understand or use it. If you don't know how to program, or how to use a Windows API, or even if you're using a GUI or not, what use is knowing how to get a pixel's color?
-
October 3rd, 2009, 01:06 PM
#12
Re: A Coding Question
Sorry I don't know what I'm doing.
But I just looked up how to do a left mouse click on C++, and I got a few lines, and they worked, then I studied them, and now I understand them. So I figured you guys would just be able to give me a few lines of code that would solve this. Didn't know it would be that big of a problem, sorry.
I'll just wait until I get my degree in computer programming...
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|