LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Converting jpeg hex code to image

Hi there,

 

I'm given a jpeg-equivalent hex code and want to convert it to the corresponding jpg-image in labview. The thing is that jpeg uses a specific compression&data format, meaning that it'd be hard to write it from scratch. Does anyone know if there's a driect (or indirect) way to convert the hex code?

 

 

0 Kudos
Message 1 of 4
(5,857 Views)

Pardon my naivete about images, but if it is really "jpeg-equivalent hex code", isn't it already translated to jpeg format? Couldn't you just save it to a file, end the file name in .jpg, and view the file as you would normally?

 

If not, please ignore this message. It seemed like a real quick experiment, anyway.

 

Cameron

 

To err is human, but to really foul it up requires a computer.
The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
Profanity is the one language all programmers know best.
An expert is someone who has made all the possible mistakes.

To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):

LabVIEW Unit 1 - Getting Started</ a>
Learn to Use LabVIEW with MyDAQ</ a>
0 Kudos
Message 2 of 4
(5,828 Views)

I'm also looking for clairification.  Do you mean you have a byte stream of a jpeg image and you want to display it in LabVIEW?

 

If so you could use the .NET picture control and give it this buffer stream, then save that stream to a PNG then use the PNG to LabVIEW data function.

 

But I think this is all silly.  Where do you get your byte stream from?  A file?  Then just use the Read JPEG File VI on the palette.

0 Kudos
Message 3 of 4
(5,815 Views)

Okay I figured I would post an example.

 

Attached is a VI where you provide a JPEG file and it will display it the easy way in LabVIEW by just opening and displaying it.  Then there is the hard way where it will open it with .NET, then resave it to a PNG, then LabVIEW will open the PNG to display it.  If you really have a byte stream and not a file then this is the way to go.  I also threw in the .NET Picture Box display which works with the byte stream we opened.  Saved in 2011

0 Kudos
Message 4 of 4
(5,810 Views)