From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
06-17-2021 01:00 PM
Hello all,
I'm working on a help window, and I want to be able to store the help contents as image data (flattened to string) in a database. I want to then unflatten and convert it back to image data and load it into a PictureBox. Is there a way I can do that without saving the image to file? Currently, the only way I see to load an image to a PictureBox is by loading a saved image.
Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.
Solved! Go to Solution.
06-17-2021 05:03 PM
It's not clear exactly what you want. Maybe this will work for you:
Run this code:
Then right-click on the "image data" terminal and select: Create -> Constant.
Use that constant in this code:
And to retrieve the image from the DB
06-18-2021 06:46 AM
Thought I explained it pretty well but I'll try again. What I want is for 'image data' to be loaded into a .NET PictureBox control directly instead of needing a saved image file. See the attached screenshot. Ignore all the math, it's to make the window look nice no matter what size the image is.
Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.
06-18-2021 07:36 AM
Why not just use a LabVIEW picture indicator?
06-18-2021 07:49 AM
I guess it's mostly that gray bevel on the outside of it that I don't like, but I might end up doing that.
Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.
06-18-2021 07:52 AM
If you use the classic version of the Picture control, you can color the border transparent.
06-18-2021 08:07 AM - edited 06-18-2021 08:09 AM
To me the classic and regular version are both basically the same thing. Do you color it with property nodes or?
EDIT: figured out it's colored by using the paint tool in edit mode, just gotta get the cursor right on the 3 pixels of the border. Thanks!
Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.
06-18-2021 08:58 AM
@FireFist-Redhawk wrote:
To me the classic and regular version are both basically the same thing. Do you color it with property nodes or?
EDIT: figured out it's colored by using the paint tool in edit mode, just gotta get the cursor right on the 3 pixels of the border. Thanks!
Note: Those bezels on the classic controls can only be colored with the coloring tool. There is no property available to access the color of a bezel.
06-21-2021 10:21 AM
I posted some code here that demonstrates a few things with the picture box.
https://forums.ni.com/t5/LabVIEW/Read-multi-image-tiff/m-p/3580103#M1002365
Here it loads an image, preserving the alpha layer information if there is any, it can select an image to display if a file contains multiple images, and does automatic scaling to the pane without additional code. I used a similar set of code to allow for rotating of an image using .Net.
https://forums.ni.com/t5/LabVIEW/How-to-rotate-objects-or-pictures-on-my-FP/m-p/3200578#M927937
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
06-24-2021 10:36 AM - edited 06-24-2021 10:45 AM
The attached may be of use with some modifications for PNG instead of JPEG. It uses .Net.