LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

display an icon inside a picture control

Hello,
 
I designed a math panel. Since, the division symbol can't be displayed as a text. I thought about creating an icon for each operator, then when the operation changes I change the icon between the oprands.The operands are numerical controls.
 
I created a picture control to display the icon. My question, how can I change the icon with each operation?
Or
Is there any why to uese the extended ASCII characters, symbols.
 
For example I wanted to display (19/34 divided by 13/12) ; I wanted to use the division symbol instead of writing (divided by).
0 Kudos
Message 1 of 6
(4,723 Views)

Hello Shamsan, standard way of dynamically loading an image in a picture control is LoadBitmapFromFile and SetControlBitmap. But in your case in my opinion you have  several alternative options available:

  1. If you have a limited list of symbols and you prefere to use an image to display them, I suggest you to load all the images in a picture list control each with a unique value associated, next displaying the appropriate symbol in a faster way simply using SetCtrlVal (panel, control, value);
  2. You can display additional characters using an appropriate Alt + xxx sequence in standard text control. As an example (using Arial font), division symbol is Alt + 0247: ÷, while this one is Alt + 0177: ± (keep Alt button pressed while typing in the numeric keypad: windows charmap application can help you in doscovering all the symbols available with a specific font)
  3. You can use a text control set with some symbol character set (symbol, wingdings, webdings...) and display the correct symbols this way. BUT you CANNOT mix texts with different character sets in the same text control


Message Edited by Roberto Bozzolo on 11-04-2007 08:42 AM


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 6
(4,714 Views)

Hello Roberto,

You wrote "

  1. If you have a limited list of symbols and you prefere to use an image to display them, I suggest you to load all the images in a picture list control each with a unique value associated, next displaying the appropriate symbol in a faster way simply using SetCtrlVal (panel, control, value);

"

How can I load the images into  a picture list and how to display them using SetControl?

 Would you  please write an example, or the call functions

Thank

0 Kudos
Message 3 of 6
(4,674 Views)

I am sorry, I was intending a Picture Ring control.

Images can be loaded into a picture ring control in the UIR editor: edit the control and use the Image / Value pairs... function to interactively select images and associate values to them. Once thia operation is complete you can simply use SetCtrlVal (panelHandle, PANEL_PICTURERING, value); function to display the appropriate image on the control.

Alternatively, images can be loaded at runtime by using InsertListItem. Loaded images can be selected in the same way as above.



Message Edited by Roberto Bozzolo on 11-05-2007 11:01 PM


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 6
(4,663 Views)
Roberto, I used picture control ring and SetCtrlVal(). It worked . Thank you very much.
0 Kudos
Message 5 of 6
(4,639 Views)
You're welcome! Smiley Happy


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 6 of 6
(4,632 Views)