|
-
Sep 13th, 2001, 10:36 PM
#1
Thread Starter
Junior Member
i am REALLY new to C++ ... help me please??
Okay - I know this will hardly be an lines of code - there is no windows to create or nothing... BUT I can't do it...
Can someone type me the code to use the SetPixelV and GetPixel API calls in C++ , and also to read what was typed at the command line??
So I type My.exe -asd -11 -nn
so I can store those last 3 values in an array?
Greatly appreciate it
-
Sep 13th, 2001, 10:37 PM
#2
Thread Starter
Junior Member
btw, C++ or C, whatever can be compiled with Borland's free BCC compiler
-
Sep 14th, 2001, 03:44 AM
#3
Monday Morning Lunatic
You can't use SetPixel and GetPixel until you have a device context to draw on 
As for command line arguments:
Code:
#include <stdio.h>
int main(int argc, char **argv) {
// argv[0] = the path to the program
// argv[argc] is defined by the standard to be NULL.
for(int i = 0; argv[i]; i++) {
printf("argv[%d] = %s\n", i, argv[i]);
}
return 0;
}
The compiler should do both C and C++. However, be sure what language you want. Files with the extension .cpp will compile as C++, and those with .c will compile as C. Make sure you decide which language you want to use FIRST
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Sep 14th, 2001, 04:54 AM
#4
Frenzied Member
You have to have a window i.e. a DC to use those functions on your window. You can use GetPixel to get the pixel info on other windows' DC's.
Code:
COLORREF pi = GetPixel(theDC,Xcoordinate,Ycoordinate);
///
SetPixel(theDC,Xcoordinate,Ycoordinate,RGB(value,value,value));
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
|