Irene_he Posted March 15, 2004 Report Share Posted March 15, 2004 Recently I created a vi to make window semi/full transparent. I don't know if this function already exists somewhere, but anyway it's free. And I post here now. Irene Download File:post-10-1079362795.zip Quote Link to comment
CraigGraham Posted March 15, 2004 Report Share Posted March 15, 2004 Cool. We can now do arbitrarily-shaped splash screens that fade into view over a second or so. I've been meaning to do that ever since I got .NET but never had the time/motivation/justification. And I have a big oval with the word "BOO!" in it that occasionally fades in at a random place on the screen and then fades out again. So is there a real use you had for this? Quote Link to comment
Irene_he Posted March 15, 2004 Author Report Share Posted March 15, 2004 Well, I was thinking to use it to overlay my image window to other windows so that user can draw on the image window, but at the same time see the underneath window, for the purpose of some instruction or training software, an idea is if you can overlay on top of your graph and make some marks (circle, rectangle or line) like a professor. I thought other people may be interested in it too, so I donate here. Quote Link to comment
CraigGraham Posted March 15, 2004 Report Share Posted March 15, 2004 Neat. Surely someone's already done this for IT training? I'd have thought someone with a laptop and projector teaching a class would already have been doing this but I've never looked. Might also be an easy way of overlaying static or animated illustrations on video footage; Powerpoint NextGen. We did a project once where we were just scripting video and monitoring the reactions of the viewers. The psychology researchers who contracted us had edited the videos to obscure, for example, the eyes, to observe the effect of reduced information. That would have been a much better system with this to allow them to modify the footage on the fly. Quote Link to comment
Irene_he Posted March 15, 2004 Author Report Share Posted March 15, 2004 some people asking for the source code of the DLL, I attach here now. Download File:post-10-1079386517.cpp Quote Link to comment
Norm Kirchner Posted March 16, 2004 Report Share Posted March 16, 2004 How do you undo it once it's done? Other than restarting LV? :headbang: Quote Link to comment
CraigGraham Posted March 16, 2004 Report Share Posted March 16, 2004 You just do it again with a different number. And never again try something like this for the first time with a value of zero on the only LV window you've got. Quote Link to comment
Norm Kirchner Posted March 16, 2004 Report Share Posted March 16, 2004 Ah young grasshopper, you assume too much. Even if you put in 255 for the value the white area stays transparent. I was trying to find a way to make the white areas white again. Quote Link to comment
Irene_he Posted March 16, 2004 Author Report Share Posted March 16, 2004 Yes, you are right, the white area would become transparent forever. That is because some bit set of the window need to reset back. I need to finish up the things on my hand before I can take a look into it. I'll keep you folks updated. Sorry for the meanwhile just restart your LabVIEW everytime. I know it's not very nice though, but... Quote Link to comment
Mario Posted March 17, 2004 Report Share Posted March 17, 2004 Hello I just want to mention that there is an other possibility to make windows transparent. If you only need the feature in WINDOWS OS environment than use the API from WINDOWS itself ! I'm currently working on an OpenG addon for doing such kind of stuff. If you would like to test my Example VI please put the content of "lvwutil32.zip" in the user.lib folder. with best regards Mario Download File:post-19-1079538066.rar Quote Link to comment
CraigGraham Posted March 18, 2004 Report Share Posted March 18, 2004 Well, Irene's post IS using the standard Win API. I can't get yours to work. It's correctly getting a win refnum but the return from getWindowLong is zero, which I guess is not right. You're using a sequence unnecessarily; frame 1 is dependent on frame 0 and the code can be in the same frame because dataflow will ensure it works in the right sequence. It may not matter which order the second two function calls take place in either. Sequences with sequence locals and wires backtracking across each other is a pain, IMHO. Quote Link to comment
Mario Posted March 18, 2004 Report Share Posted March 18, 2004 Are you using "Transparency.vi" as the window name ? And yes i know that the sequenze is unnecessary . I just wanted to highlight the function steps :-) Mario Quote Link to comment
CraigGraham Posted March 19, 2004 Report Share Posted March 19, 2004 I wasn't- I was using "Transparency.vi Front Panel". But it doesn't appear to work using "Transparency.vi" either, yet again Get Window Refnum is returning a refnum and GetWindowLong is returning zero. If I deliberately type garbage then Get Window Refnum returns zero, so it seems it IS correctly getting the window at the start. Curious. Quote Link to comment
Mario Posted March 19, 2004 Report Share Posted March 19, 2004 Hello You have to leave out the "Front Panel" substring and only use "Transparency.vi" cause LabVIEW adds the string "Front Panel" to the String in the Window, but the name is only "Transparency.vi" Hope it helped. have a nice day Mario Quote Link to comment
CraigGraham Posted March 19, 2004 Report Share Posted March 19, 2004 Yes- I have tried "Transparency.vi" two posts back and it don't work. Anyone else tried it here and care to comment? I'm on XP. What OS was it developed on? Though any major changes would have brought up errors that the function wasn't found in the DLL. Quote Link to comment
TomiF Posted March 19, 2004 Report Share Posted March 19, 2004 Hello! I tested the VI called Transparency.vi and it runs... To test this vi I copied several files to my /LabVIEW7/user.lib folder LVWUtil32.dll 33kb MANUAL.WRI 468kb Readme.doc 24kb Winevent.llb 541kb WINKEY.LLB 68kb WINNET.LLB 51kb Winsys.llb 164kb WINUTIL.LLB 646kb My system: WinXP SP1, LabVIEW7 I testet the VI with different windows, like notepad and so on... and it works... Quote Link to comment
CraigGraham Posted March 19, 2004 Report Share Posted March 19, 2004 Interesting. I didn't bother doing the copy, but I did extract the zip file to the same directory as the VI itself and it now works. My existing winutil.llb must be an old and unreliable version. Quote Link to comment
CraigGraham Posted March 19, 2004 Report Share Posted March 19, 2004 Cool. To do colour-based transparency, wire a numeric constant to the second input of SetLayeredWindowAttributes and change the bottom input from 2 to 3. White I can do, but I can't seem to get red to work. Download File:post-19-1079702257.vi Quote Link to comment
Mario Posted March 19, 2004 Report Share Posted March 19, 2004 Anyone interested in changing the shape of a Front Panel ? :thumbup: Quote Link to comment
TomiF Posted March 19, 2004 Report Share Posted March 19, 2004 Yes it work's :thumbup: great! MoreTransparency.vi Quote Link to comment
CraigGraham Posted March 19, 2004 Report Share Posted March 19, 2004 I already did the arbitrary front panel shape thing- that's what my big "Boo" was about early in the thread. So neeer. Quote Link to comment
aledain Posted March 22, 2004 Report Share Posted March 22, 2004 [Advert] ICON Technologies have a low-cost toolkit that does this stuff too ;-) www.icon-tech.com.au Quote Link to comment
smellydan Posted April 8, 2004 Report Share Posted April 8, 2004 Worked great in LV7 thanks!!! :thumbup: I tried to duplicate the code in LV6.1 but it did not work, any ideas. Quote Link to comment
Vitor Rocha Posted August 5, 2004 Report Share Posted August 5, 2004 I'm working in LabView 7.1 and this VI works fine...with no trouble at all... :thumbup: Quote Link to comment
Deep_Blue Posted August 16, 2004 Report Share Posted August 16, 2004 For me this seems like the transparency after running the vi is actually a redraw-problem. If you move the help window on top of a white window, background will change back from transparent to white again. At least for me it does, is the behaviour the same with other users as well? Furthermore I couldn't download Irene's source code and don't actually know how this is done, thus I'm not able to debug it further. Nice thingy, might use it sometime just for fun if I can reverse the transparency programmatically. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.