View Single Post
  #2   Spotlight this post!  
Unread 08-02-2010, 16:38
MattD's Avatar
MattD MattD is offline
Registered User
AKA: Matthew Douglas
FRC #0228 (GUS Robotics)
Team Role: Alumni
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Indianapolis, IN
Posts: 185
MattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to behold
Send a message via AIM to MattD
Re: Displaying Camera Image in C# Dashboard

Quote:
Originally Posted by PranavSathy View Post
The Dashboard Code from LabVIEW doesnt help at all , ive read through the whole thing countless times, the PCVideoServer.cpp I have also read through that code,infact I am sitting right in front of it lol, that is why there is a if(readBytes > 1000) code, it makes sure I am not sending the header or imageSize as parameters to the MemoryStream, actually after much testing, i got the image to display at about .01 fps rofl, it updates the image irregularly and it is lagging BEYONG belief, here is my current code for that image processing:
The problem is that you're just randomly grabbing chunks of data > 1000 bytes in length, throwing it into an image, and hoping that everything lines up correctly.

I would recommend reading 8 bytes first, and look for the 0x01,0x00,0x00,x00 header in the first 4. If that's there, read the length from the next 4 bytes. Then, read in that number of bytes from your networkstream, and pass it into Image.FromStream(). Repeat.
__________________
GUS Robotics Team 228

2010 WPI Engineering Inspiration Award
2010 WPI Regional Champions (Thanks 230 & 20!)
2010 CT VEX Champions
2010 CT VEX Innovate Award
2009 QCC VEX Champions
2009 CT Motorola Quality Award
2007 CT J&J Sportsmanship Award
2006 CT Best Website Award
Reply With Quote