To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This VI converts JPEG string to LabVIEW image.
Description
You can convert JPEG string to LabVIEW image. This is particularly useful if you wish to view the image of JPEG string on VI.
Requirements
Steps to Implement or Execute Code
Additional Information or References
In case you need JPEG string to check the functionality of this example, you can find example code on the same web page that loads user-specified JPEG file and converts LabVIEW image to JPEG string.
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
Would you be able to downconvert these VIs to 2010? It'd be cool to see how the conversion is implemented.
No problem, attached in zip
-Artur
If I am writing to Memory Stream in C#, can I access the data I am writing to memory stream in Labview?
I am writing something of this sort from a tracked human face to memrory stream but I am not sure how to read the process in labview:
this.facePoints3D = frame.Get3DShape();
using (MemoryStream stream = new MemoryStream())
{
var sw = new StreamWriter(stream);
foreach (var vector in facePoints3D)
{
float zvect = vector.Z;
//sw.WriteLine(max);
sw.WriteLine(zvect);
// The string is currently stored in the
// StreamWriters buffer. Flushing the stream will
// force the string into the MemoryStream.
sw.Flush();
}
stream.Position = 0;
StreamWriter writemem = new StreamWriter("coordinates.txt", true);
using (writemem)
{
var read = new StreamReader(stream);
var myread = read.ReadToEnd();
writemem.WriteLine(myread);
}
}
Thanks man!
Hi,
You can do that over "AllocHGlobal":
Process A (C#) Marshal -> AllocHGlobal -> Marshal -> Copy -> pointer
Process B (LabVIEW) Marshal -> AllocHGlobal -> Copy -> array
-Artur
Can you give an example of both instances please?
I am sorry, missed your question, do you still need an example or you done?
-Artur
I was hoping to use your example to decode a JPG string from an old video camera, which is 24-bit. I noticed that your DOTNET code only works with 32-bit images. Is there a reason for that? Could you refer me to a resource where I could learn how to tailor your code for 24-bit JPGs?
For anyone interested in this here's a WinAPI method to convert an image stream into a common 32-bit RGB array. Doesn't require saving a stream into a temporary file.