ni.com is currently experiencing unexpected issues.

Some services may be unavailable at this time.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help! how to make transparent front panel

Hi:
 
     I intend to show a vi when my system call it but the backgound have color and I want it to be transparent. I search inside forum and get this thread http://forums.ni.com/ni/board/message?board.id=170&message.id=178411&query.id=105714#M178411 . After that I try follow that method using "call DLL" to let my front panel become transparent but I fail.
 
     I attach my vi and hope come one can help.
 
thank in advance.
0 Kudos
Message 1 of 10
(8,409 Views)


@TK Chang wrote:
Hi:
 
     I intend to show a vi when my system call it but the backgound have color and I want it to be transparent. I search inside forum and get this thread http://forums.ni.com/ni/board/message?board.id=170&message.id=178411&query.id=105714#M178411 . After that I try follow that method using "call DLL" to let my front panel become transparent but I fail.
 
     I attach my vi and hope come one can help.
 
thank in advance.


What version of LabVIEW do you have. In LabVIEW 8 this is a standard feature of VIs you can set in the VI Properties of your VI under Window Appearance->Customize->Window Runs Transparent.

Rolf Kalbermatter

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 2 of 10
(8,397 Views)
You can try looking at this.

___________________
Try to take over the world!
0 Kudos
Message 3 of 10
(8,392 Views)

Hi rolfk  my LV version is .7.1

 Thank tst that VI work but it make the whole windows transparent. What i want is that moving man and callout remain clear only the backgound become transparent.

Any suggestion?

 

 

0 Kudos
Message 4 of 10
(8,367 Views)

The function displays white as transparent, so you can color the background white (it has to be pure white - 255, 255, 255) and set the transparency to 255 and the background will not be seen. Note: I don't know whether this is part of the design of the function or a bug.

Another option - you can use some of the Windows API functions to change the shape of a window (including to the shape of a bitmap). The problem with that is that your bitmap changes shape because the man moves. There were some VIs showing how to do this in one of the LTR challenges, but LTR was closed down and their stuff is no longer available. I might have these VIs somewhere and I can look for them in a few days if you want them.


___________________
Try to take over the world!
Message 5 of 10
(8,341 Views)
Thank a lot tst, it work. Smiley Very Happy
 
By the way I am try to understand how to use windows API. For example function "GetWindowLong" got 2 parameter one is "hWnd" I know is get the window name and the other "nIndex" I search in MSDN (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/wi...) but I can't figure out why the input value is "-20".
 
Same as function "SetWindowlong" and "SetLayeredWindowAttributes". All these APi i can find the explaination in MSDN but I don't know what value I should put for those parameters. Is there anyway to find out what vaule I should give for those parameter?
 
yes, if you can get that example for change bmp shape then pass to me.
 
Thank very much

Message Edited by TK Chang on 01-11-2007 09:44 PM

0 Kudos
Message 6 of 10
(8,317 Views)


@TK Chang wrote:
Thank a lot tst, it work. Smiley Very Happy
 
By the way I am try to understand how to use windows API. For example function "GetWindowLong" got 2 parameter one is "hWnd" I know is get the window name and the other "nIndex" I search in MSDN (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/wi...) but I can't figure out why the input value is "-20".
 
Same as function "SetWindowlong" and "SetLayeredWindowAttributes". All these APi i can find the explaination in MSDN but I don't know what value I should put for those parameters. Is there anyway to find out what vaule I should give for those parameter?
 
yes, if you can get that example for change bmp shape then pass to me.
 
Thank very much

Message Edited by TK Chang on 01-11-2007 09:44 PM


That is because Micrososft defined for readibility constants and usually only documents them in MSDN. If you want to know the numeric value (which you need when trying to call such a function from non-C environments) you basically have to install the plattform SDK from Microsoft and search in the headers for the constant name and see what value it has assigned too.

A search of the constant name as documented in the SDK on the web might sometimes also give results such as an include form for Visual Basic, and interface description for Delphi or simply C header files from some Wine patch, but there is no quarantee and you might have to look through many hits before finding something useful.

All these options do however require you to understand a bit about the syntax of the programming environment you got the solution from such as C syntax (the plattform SDK is completely for C(++) too), Delphi, or Visual Basic.

Rolf Kalbermatter

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 7 of 10
(8,301 Views)
Thank rolfk , now I know where can I find out those information.
 
0 Kudos
Message 8 of 10
(8,259 Views)
Here are the LTR VIs (7.0). The key is calling the LoadImage function.

___________________
Try to take over the world!
0 Kudos
Message 9 of 10
(8,247 Views)
Thank tst
0 Kudos
Message 10 of 10
(8,188 Views)