LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert string data to image data.

Solved!
Go to solution

I don't know how save .txt in "Backslash (\) Codes" format. When I use "Write to Text File Function", I get following - test.
With the help of a copy-paste got - test1.

Download All
0 Kudos
Message 11 of 20
(4,206 Views)
Solution
Accepted by topic author Alexdmk

As predicted 🙂 Write to Binary File is all you need!

 

Example_VI.pngtestbmp.jpg

 

Unfortunately I had to use an online converter from BMP to JPG because BMP isn't a format accepted by this forum, but the code still works.

The VI is saved in 2017, the snippet is saved using the LAVA tool to 2013.


GCentral
Message 12 of 20
(4,191 Views)

Thank you so much. You all really helped me! Smiley Happy

0 Kudos
Message 13 of 20
(4,174 Views)

Here is a vi that do bitmap string to image conversion:

https://lavag.org/files/file/304-convert-string-to-bitmapvi/

0 Kudos
Message 14 of 20
(4,142 Views)

I have similar issue but in my case only half image is showing.

anyone has a idea what is going wrong here?

Kuddo welcomed
CLAD-CTD
0 Kudos
Message 15 of 20
(4,127 Views)

This seems to be a PNG- file. What has happened?

Greets, Dave
0 Kudos
Message 16 of 20
(4,127 Views)

Hi Gab,

 

what is going wrong here?

1. You attached a file with a suffix "JPG", which is a "PNG" instead.

2. That PNG is all black for me. (It's rather small with just 2kB for 640×520 pixel.)

 

Wild guess:

3. You didn't read the whole image from your device, but just the first half.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 17 of 20
(4,127 Views)

Yes, my favourite picture viewer "IrfanView" showed me a black picture too (even after confirming the converting-question), but the TotalCommander- Viewer showed me this:

 

test.jpg_TC-Viewer.png

 

And this is not half of the picture...

Greets, Dave
0 Kudos
Message 18 of 20
(4,122 Views)

Thanks for reply. yes, I am missing some bytes from device but now working complete image 

 

Thanks.

Kuddo welcomed
CLAD-CTD
0 Kudos
Message 19 of 20
(4,114 Views)

Thanks for reply. yes, I am missing some bytes from device but now working complete image 

 

Thanks.

Kuddo welcomed
CLAD-CTD
0 Kudos
Message 20 of 20
(4,114 Views)