LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to save the contents of a image in an ASCII text format?

There is a function named GetUserBitmapFromText() in the graphcursors.fp instrument driver.It can loads an ASCII format text into a bitmap id.But I don't know which function can save the contents of a image in an ASCII text format.
Any advice is welcome.
0 Kudos
Message 1 of 4
(3,270 Views)
Hello

You should use the bitmap functions for this. Use the SaveBitmapToFile() function to save a bitmap to a file and GetBitmapFromFile() to load it from a file.

i hope this helps

Bilal Durrani
NI
Bilal Durrani
NI
0 Kudos
Message 2 of 4
(3,270 Views)
But I just want to save the binary data to my own database , I mean that I can extract the image data from my own database if it is needed . Thanks.

Chen
0 Kudos
Message 3 of 4
(3,270 Views)
The GetUserBitmapFromText function is an undocumented function that is only used by that instrument driver. Its purpose is to load images in the type of format that is saved in .tui files (the "Options>>Save in Text Format" option in the UI Editor). We use this format in graphcursors.fp in order to avoid having to distribute all those icon files.

The function is not documented because you cannot, using the UI Library, programmatically save files in this format. Therefore there wouldn't be any ocasion in which you would this function. If you would like to do something similar in your own application you can: you'd have to use the UI Editor to save the images, and then you can use this function to load them.

Having said this, unless you have
a very good reason to use this ASCII format, you really should be doing what Bilal recommended. That is the supported, official way to save and load images.

Luis Gomes
NI
0 Kudos
Message 4 of 4
(3,270 Views)