View Single Post
  #22   Spotlight this post!  
Unread 25-03-2009, 18:05
RyanCahoon's Avatar
RyanCahoon RyanCahoon is offline
Disassembling my prior presumptions
FRC #0766 (M-A Bears)
Team Role: Engineer
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Mountain View
Posts: 689
RyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond repute
Re: Live Video on Dashboard

Quote:
Originally Posted by xtreampb View Post
I am new to programming things to send over a network. How do you compress files and images in the C++ code. How would i uncompress the files and images in VB.NET. I would love to see the hard code of the camera feed functions.
You can use the imaqFlatten(...) method from nivision.h to compress images in C++, but this puts it into what's probably best called a proprietary format. It supposedly can be set to use JPEG to compress the image, so you could probably extract a JPEG from it somehow, but it's most likely going to be padded with extra data.

There's also a series of imaqWriteTYPEFile functions, but these write to the filesystem, so you would then have to read in the file again in order to send it over the network. Unless of course someone knows if there are/how to use pipes in VxWorks.

Assuming you've gotten your JPEG over the network unconvoluted

Code:
Dim im = New Bitmap(stream)
where stream is the stream coming from your network connection, or if you had to reconstruct the data because it was packetized to fit in the 984 byte constraint, you can use

Code:
Dim im = New Bitmap(New IO.MemoryStream(byteArray))
--Ryan
__________________
FRC 2046, 2007-2008, Student member
FRC 1708, 2009-2012, College mentor; 2013-2014, Mentor
FRC 766, 2015-, Mentor