Screen Capture Using C

A

alr288

Hello All,
I recognize that this question has already brought about some debate
so I am going to ask as a specific question as I can. I am currently
try to create a cross platfrom screen parser in C. I was able to find
C code that grabs the pointer to the array of screen pixels in memory
for the OS X platform:

PixMap pixMap;
GetQDGlobalsScreenBits((BitMap*)&pixMap);

I would like to be able to grab the screen image from a windows based
machine and a unix based machine. I can find the code for C++,
however, I am unable to find the technique that works in C. I realize
that this is platform specific, but I have not been able to find an
appropriate group to post this question to other then this group. If
anyone knows of a group that could provide the answer or of some place
where I can find decent documentation on C I would greatly appreciate
it.
Best, Andrew
 
M

Mark McIntyre

Hello All,
I recognize that this question has already brought about some debate

has it...
I would like to be able to grab the screen image from a windows based
machine and a unix based machine.

To do this, ask in comp.unix.programmer and a windows programming
group. You can't do this in standard C, it is by definition
implementation specific.
. I realize
that this is platform specific, but I have not been able to find an
appropriate group to post this question to other then this group.

Frankly, rec.motorcycles is no less appropriate....
If anyone knows of a group

see my first comment above.
 
G

Gordon Burditt

I recognize that this question has already brought about some debate
so I am going to ask as a specific question as I can. I am currently
try to create a cross platfrom screen parser in C. I was able to find
C code that grabs the pointer to the array of screen pixels in memory
for the OS X platform:

Under UNIX, you cannot guarantee that there is a screen (on an
ASR-33 teletype?), or that there are pixels (character-based terminals
such as VT-52 and VT-100 and emulators thereof are common). And
you can't guarantee being able to read back what is on the screen
in any case. The screen, if there is one, may well be connected
to a machine miles (or thousands of miles) away from the one running
the program, and there may be no protocol to ask for a screen dump
from it.

Gordon L. Burditt
 
W

Walter Roberson

Under UNIX, you cannot guarantee that there is a screen (on an
ASR-33 teletype?), or that there are pixels (character-based terminals
such as VT-52 and VT-100 and emulators thereof are common).

True, and everything you said -also- applies to OSX, as one can telnet
or rlogin or ssh in to an OSX machine [which is unix underneath
the dressings.]
 
K

Keith Thompson

I recognize that this question has already brought about some debate
so I am going to ask as a specific question as I can. I am currently
try to create a cross platfrom screen parser in C. I was able to find
C code that grabs the pointer to the array of screen pixels in memory
for the OS X platform:

PixMap pixMap;
GetQDGlobalsScreenBits((BitMap*)&pixMap);

I don't know what PixMap and BitMap are, but if GetQDGlobalsScreenBits
reads data into a BitMap, why not declare a BitMap rather than a
PixMap? Casts are rarely necessary; they're often an indication that
something should be of the correct type in the first place.
I would like to be able to grab the screen image from a windows based
machine and a unix based machine. I can find the code for C++,
however, I am unable to find the technique that works in C. I realize
that this is platform specific, but I have not been able to find an
appropriate group to post this question to other then this group. If
anyone knows of a group that could provide the answer or of some place
where I can find decent documentation on C I would greatly appreciate
it.

This is *extremly* platform specific. As far as C is concerned, there
may not even be such a thing as a "screen image"; even if there is, it
may not be accessible. The best you can do is write something that
will work in some environments under some circumstances.
 
M

Mark McIntyre

On 11 Apr 2005 22:41:48 GMT, in comp.lang.c ,
Under UNIX, you cannot guarantee that there is a screen (on an
ASR-33 teletype?), or that there are pixels (character-based terminals
such as VT-52 and VT-100 and emulators thereof are common).

True, and everything you said -also- applies to OSX, as one can telnet
or rlogin or ssh in to an OSX machine [which is unix underneath
the dressings.]

and Windows, for what its worth. And PalmOS, bizarrely, tho its more
common to use a Palm handheld to telnet in to a unix server.
 
B

BGreene

Hello All,
I recognize that this question has already brought about some debate
so I am going to ask as a specific question as I can. I am currently
try to create a cross platfrom screen parser in C. I was able to find
C code that grabs the pointer to the array of screen pixels in memory
for the OS X platform:

PixMap pixMap;
GetQDGlobalsScreenBits((BitMap*)&pixMap);

I would like to be able to grab the screen image from a windows based
machine and a unix based machine. I can find the code for C++,
however, I am unable to find the technique that works in C. I realize
that this is platform specific, but I have not been able to find an
appropriate group to post this question to other then this group. If
anyone knows of a group that could provide the answer or of some place
where I can find decent documentation on C I would greatly appreciate
it.
Best, Andrew

Since this is off topic.
If you do not find a better answer send me an e-mail and I can show you how
to do it, in the old fashioned Windows API.

Barry
 
B

BGreene

Hello All,
I recognize that this question has already brought about some debate
so I am going to ask as a specific question as I can. I am currently
try to create a cross platfrom screen parser in C. I was able to find
C code that grabs the pointer to the array of screen pixels in memory
for the OS X platform:

PixMap pixMap;
GetQDGlobalsScreenBits((BitMap*)&pixMap);

I would like to be able to grab the screen image from a windows based
machine and a unix based machine. I can find the code for C++,
however, I am unable to find the technique that works in C. I realize
that this is platform specific, but I have not been able to find an
appropriate group to post this question to other then this group. If
anyone knows of a group that could provide the answer or of some place
where I can find decent documentation on C I would greatly appreciate
it.
Best, Andrew

Still off topic, I believe I still have the source code to copy the screen
from the game TriPeaks and play it forever, although I think I hard coded
(oops) some of the screen dimensions. I wrote it long ago to play with
moving a mouse and clicking buttons in the Windows API. It does some
minimal pixel analysis and game logic as well and may be a good sample.

Barry
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top