Click here to Skip to main content
15,887,350 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
I was wondering if there is a way to get data directly from graphic port in c# or c++? Like what we do with serial ports(we can open serial ports and read data from it).
Posted
Comments
Richard MacCutchan 11-Nov-12 7:05am    
The short answer is: Yes. The longer answer is: you need to use the details of the cable type and channel protocol to get the data and interpret it.
mehdi_k 11-Nov-12 9:32am    
a normal graphic port uses a serial port, so is it the same way we use for other serial ports? would you explain more and give a code sample. Thanks.
Richard MacCutchan 11-Nov-12 9:35am    
I don't have any more information on this, you need to do some research for yourself.
mehdi_k 11-Nov-12 15:27pm    
Thnaks.

1 solution

If you're talking about the port you plug your monitor into, you do NOT treat it the same way you treat a serial port. The same code will not work.

What are you trying to do with this??
 
Share this answer
 
Comments
mehdi_k 11-Nov-12 15:24pm    
That is exactly what I'm trying to do, I want to get data from the port that I plug my monitor into, see if my monitor gets it and shows me as images I want to get them directly from the port in my for example c# app.
Please help.
Dave Kreskowiak 11-Nov-12 16:20pm    
Not going to happen.

You really don't understand how this works. You can get a little information FROM the monitor, such as its capabilities and make/model/sn, but you cannot send it commands and it will not send you the image being displayed or any part of it.

The port you plug the monitor into is not exposed like the Serial Port is. It doesn't even work anywhere close to the same way. You cannot just "open a port" and start talking to it. It's nowhere near that simple.

Talking to the monitor is only done through the video driver, and what is exposed to your code is very limited in capbility to keep the monitor in a known state so the video driver can maintain control of it.

The onyl way you're going to get more capability is if you wrote your own video driver. From the sounds of things, that is VERY FAR over your head.
mehdi_k 12-Nov-12 5:26am    
Yeah I thought so, but the data that comes through the port is already processed by Graphic card and it's driver so no need to write a driver(witch is VERY FAR over my head!). so the thing is how to communicate to port and get the data(that has been already processed), and the next thing is to translate the data to what you want(for example an image).
Anyway, Thanks for your time.
Dave Kreskowiak 12-Nov-12 8:19am    
You're not getting it. You're not going to talk to the port. You talk to the video driver.

Also, getting the image that's displayed is more than a bit tricky. For example, if you think you're going to get the image of a DVD playing in a window, you're mistaken. The channel is protected for copyright reasons.

You won't get back any image data from the monitor at all, and only partially from the video driver.

I have no idea what the ultimate goal of doing this is, so....
mehdi_k 13-Nov-12 8:08am    
if you want to know the goal:
a few ago I tried to get the image of a game, but I couldn't do that with print screen, so I tried to use directx in a c# app, but I needed to get image of back buffer in order to get the image of the game that was playing because the front buffer has the desktop image. in nobody knows reason :
http://www.codeproject.com/Questions/458442/taking-screenshots-from-game-environment-using-Dir
I couldn't do that too.
so I thought maybe in this way I'd be able to do that witch so far...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900