02-03-2017 02:47 AM
Hello everybody,
I have a question. I think it is an easy one but I am not sure if it is the correct way. What I want to do, is to show a picture of a pin configuration. The picture is a .jpg data. So when the user presses a button a new window should pop up and show the picture of the pin configuration.
Now I have in my mind that when I press the button a new panel gets loaded. I found a module with the name "Picture". So I would use this module in the new panel and display the .jpg with it. Is this a good way or is there a better way. If yes, can someone explane the steps what I have to do?
Best regards
Solved! Go to Solution.
02-03-2017 03:06 AM
Using the Picture Control, if that one is what you call "module" is the correct way to display images. DisplayImageFile is the easiest way to display a picture in a picture control.
Looking in the help and in the example finder will give you additional functions for this task.
02-03-2017 03:08 AM - edited 02-03-2017 03:21 AM
Thank you for your fast answer.
But I must also create a new panel? In the panel where I have the button there are also other things. My plan is to show the picture seperate.
02-03-2017 03:24 AM - edited 02-03-2017 03:26 AM
The DisplayImageFile can load images in various formats, not only bitmap files:
Displays the contents of an image file on a picture control.
This function supports the following image types: .tif, .pcx, .bmp, .dib, .rle, .ico, .jpg, .png, .wmf, and .emf.
Once loaded in memory the image becomes a bitmap object, but this does not imply you are limited to .bmp files. You actually may even not know anything of the bitmap object in memory if you only need to display the image file on the panel.
02-03-2017 03:29 AM
Yeah I understand that. But what I mean is that I have some configuration on my panel. Now the user changed something on the panel and would like to get the old options. These old options are saved in the .png. When I press the button for the old options the pictures can be seen. The problem is, that I see the picture in the same panel as my options. Under the picture my options to change are hidden. So I would like to have the picture in a saperate window that I can shift on my computer where I want. So I can look on the picture an set the options on the panel. 🙂
02-03-2017 03:33 AM
You modified your post while I was answering!
It's up to you where to put the picture control: you can either display it on a separate panel or have it hided and show it only at operator's request. It depends on how you develop the user interface. If not displayed on the main UI, you must create a panel for the picture control: controls must be placed on a panel.
02-03-2017 03:35 AM
Ah sorry 🙂
Than you have answered my question. Thank you very much.