Example Program Drafts

cancel
Showing results for 
Search instead for 
Did you mean: 

Splash Screen Effect in LabVIEW

If you've ever researched methods for creating a splash screen in LabVIEW, you have probably found that most methods for creating a splash screen in LabVIEW have some shortcomings or limitations -- especially when you want to turn your VI into an executable. This has been frustrating for many LabVIEW users (myself included), so I decided to see if I could develop a method for creating a splash screen effect in LabVIEW that would meet two primary criteria:

  1. It has to be easy for LabVIEW users of all skill levels to implement.
  2. It has to work whether the code is executed as a VI or built into an executable.

 

NEW FOR 2016:

Add a splash screen effect to ANY VI in just two steps!*

 

The Splash in Main distribution includes 6 fully-documented and functional example VIs that demonstrate how to use the Splash in Main_BRAT VI:

  • Example 1 - Display a splash screen until a user-defined amount of time has elapsed
  • Example 2 - Display a splash screen until a user-defined event occurs
  • Example 3 - Display a splash screen that shows a different background graphic each time the code is executed
  • Example 4 - Display a splash screen that can be used in applications that allow the user to resize the main VI front panel when the main VI is running
  • Example 5 - Display a splash screen that shows only the foreground of the graphic on the Windows desktop. The VI front panel is COMPLETELY TRANSPARENT except for the graphic.
  • NEW >> Example 6 - Display a splash screen that shows an ANIMATED, transparent graphic.*
  • NEW >> Exercise 1 - Add a Splash Screen to a VI in Two Steps. This exercise guides the user in how to add a splash screen effect to ANY VI in just two steps!*

 

* LabVIEW 2015 version only.

 

Run the included example VIs to see the behaviors that can be achieved.

Complete Exercise 1 to learn how you can add a splash screen effect to ANY VI in just two steps!

 

 

If you're tired of creating boring, rectangular splash screens in LabVIEW, download this code now!

 

The examples to the right show what can be achieved.

 

The images to the right show two of the images that you'll see when you run Example 5.

 

All you see is the foreground image and the Windows desktop.

 

Transparency of the image is maintained and the VI front panel is completely transparent as well.

ScreenHunter_99 Apr. 16 19.13.jpg

Example 1

 

ScreenHunter_96 Apr. 16 19.12.jpg

Example 2

Thanks to engineer27 who commented in 2009 about using a graphic with a transparent background. I could not readily duplicate the described behavior, but always wanted to find a way to make it work.

Also thanks to for a post pointing to the Transparent Window.llb code that I used to implement the transparent front panel effect.

Finally thanks to Steve Orth who wrote the original Transparent Window VIs.

 

 

Readme file for Splash in Main_BRAT VI

 

Description

 

The Splash in Main_BRAT VI enables you to easily create a splash screen effect in your main application VI.

 

Application Software

 

LabVIEW 2015 or higher

 

Driver Software

 

None.

 

Description of Operation

 

The Splash in Main_BRAT VI produces a splash screen effect by scrolling the main VI's front panel. The size of the splash screen is defined by the area occupied by a target decoration (the front-most decoration) on the main VI's front panel.

 

When the Splash in Main_BRAT VI runs, the main VI's front panel is resized and then scrolled so that the splash screen area is displayed.

 

The splash screen will close based on the setting of the "Close splash screen on (Timer)" input: If set to "Timer" (default), the splash screen closes after the number of milliseconds specified by the "Splash delay (3000 ms)" input. If set to "Event", the splash screen remains open until a user-defined event occurs.

 

After the splash screen closes, the main VI's front panel is set back to its original size and scrolled to show the main VI's functional front panel area.

 

Screenshots

 

Splash In Main Example 1 - Pre Run.png

This screenshot shows an example top-level VI before the run button has been pressed.

 

Splash In Main Example 1 - Example Splash Screen Displayed.png

This screenshot shows the example splash screen that appears when the run button in the main VI is pressed.

 

Splash In Main Example 1 - Example Splash Screen Closed and Main VI Running.png

This screenshot shows the main VI running after the splash screen has closed.

 

 

Extracting the files

 

The Splash in Main_BRAT VI is supplied as a zip archive containing all required items.

 

Additional Information

 

Additional information related to the use and operation of the Splash in Main_BRAT VI may be accessed via:

  • Completing Exercise 1 - Add a Splash Screen to a VI in Two Steps
  • Execution of the usage example VIs
  • The block diagrams of all included VIs
  • The documentation within all included VIs


Developed by

 

Mark Ridgley

Mark.Ridgley_LabVIEW.Developer@comcast.net

 

Change control:

 

11-28-2007Modified code to read and save the original property settings of the main application VI so that the main VI's panel can be restored to the settings originally assigned by the developer.Fixed typos throughout.Minor cosmetic changes.

 

11-29-2007Added the "Splash in Main - Restore Main VI Properties" VI to the package. When using the "Splash in Main" VI in Event mode, you must add this VI to your main application VI to restore the original property settings of the main application VI.Updated VI documentation as required to reflect the use of this new VI.Updated palette views to show this new VI.

 

11-31-2010 Updated code for LabVIEW 2010.

 

12-07-2011 Updated code for LabVIEW 2011, implemented panel fade effect as suggested by forum member Joji, implemented several ideas as suggested by forum member Vlad Tokarev, Added two new Usage Example VIs.

 

03-10-2012 Updated code to add note regarding user reports that the main window flashes for a few milliseconds before the splash screen appears. Noted that this can be corrected by setting the main VI to run transparently. To do this, go to VI Properties >> Window Appearance >> Customize. Ensure that  "Window runs transparently" is checked and set the value to 100%.

 

04-16-2013 Added the transparent front panel effect and Example 5, which demonstrates it.

 

01-01-2016 Updated code for LabVIEW 2015. Added Example 6, which demonstrates how to display a splash screen that shows an animated, transparent graphic. Updated code to convert the Splash in Main VI into a BRAT VI to make it even easier to add a splash screen effect to any VI. Added an exercise that guides the user in how to add a splash screen effect to a shipping LabVIEW example VI in two steps.

 

NOTE: Download the LabVIEW 2015 version of the code to get all of the newest features and ease-of-use enhancements.

 

Comments
Member BetaCommunityCo
Member

Splash Screen Effect in LabVIEW

cool~~

Member engineer27
Member

I used a graphic with a transparent background. The splash effect maintained the transparency, showing only the foreground of the graphic on the windows desktop. Very cool, but unexpected. I assumed I would see the gray Labview background behind the graphic.

I'm not sure why it behaves that way, but glad it does.

Member ijerom
Member

thanks Mark

Coooool ~

Member Rick K
Member

You should add a screenshot to this listing

Member Alan_Gilchrist
Member

Seems to be some vi's missing.  Show Hide Scrollbars.vi, Read Main Panel Bounds and Origin.vi, Adjsut Panel Bounds Based on Scrollbar visibility.vi, and Read Scrollbar Visibility.vi.

Member Mark.Ridgley Member
Member

Thanks for downloading and also for taking the time to notify me about the missing VIs.

I apologize for the inconvenience.

I've uploaded a new version of the zip file that contains everything plus what you noted was missing. The filename is still "Splash in Main_LabVIEW_2010.zip".

Thanks again,

Mark Ridgley

Member Joji
Member

Very Cool. One thing I noticed is the with Professional splash screens, they will usuall fade-in and fade-out before the program. Even with this as a an executable it briefly displays the main panel before jumping to the splash screen.

I edited your code with a Fade IN VI and Fade Out VI. I inserted the Fade In VI within the Display Splash Area.vi. By setting the default VI property to 100% transparent, this makes the effect of fading in the Splash screen with getting a "peek" at the VI.  Also, I used a Fade Out and Fade In between the transition between the splash screen and VI. Essentially, anytime you are doing these programmatic moves you are transparent and there is a smooth transition back and forth.

Very cool set of VIs! Thanks for doing this.

Display Splash Area.pngFade In.png

Restore Main VI.png

Fade Out.png

Joji
Member Alan_Gilchrist
Member

Thanks Joji.  Cool addition to a cool effect.

Member Mark.Ridgley Member
Member

Joji,

Thanks for taking the time to review -- and improve -- my example. I'm glad you like it.

I like what you did with the fade VI. It really makes the effect smoother.

If you haven't done so already, you should post your fade VI to the LabVIEW Community.

I had written a fade VI myself, but I didn't think to use it in this example VI. Great thinking! Would you mind if I incorporate your changes into the posted example? Of course I would give you full credit for your great addition!

Thanks again,

Mark Ridgley

Member B.Settles
Member

Joji,

I can't drop your snippets onto my block diagram. I checked, and it works with other snippets. Don't know why yours aren't working. Can you post the code another way?

"All truths are easy to understand once they are discovered; the point is to discover them." -- Galileo Galilei

Member Vladiator
Member

Could not make it work in LV2011. Any instructions on how to set this up?

Member Vladiator
Member

I was looking to Splash screen code for quite some time and coulud not find anything useful until I saw Mark's Splash in Main code posted here. It's quite interesting that NI has not implemented a splash code for 25 years of its first release!

I give 5-star rating for Mark's code that is attached here. Mark and I were communicating offlist and he was working on issues and examples that are now included in the latest code that he attached here.  The examples he wrote are well documented and self explanatory, and it would be quite ueasy to add them to your project. I've tested the code quite extensively on a few projects, and it's working quite well. There is a minor issue with a main window flashing for a few milliseconds before the splash screen shows up, but it's mostly related to how LabVIEW displays the FP.

The fade in/out effects are great and can be included and customized. I highly recommend this code and appreciate Mark's work on this project.

Member Mark.Ridgley Member
Member

Vlad,

I'm glad to hear that you find the Splash in Main code useful and have already successfully used it on several of your projects. Your early success in using the Splash in Main code is evidence that the Splash in Main code is meeting its two primary objectives -- it is easy to implement for LabVIEW users of all skill levels and it works as designed whether the code is executed as a VI or built into an executable.

Thanks for taking the time to work with me to improve this code. I really appreciate it.

Mark Ridgley

Member Mark.Ridgley Member
Member

Vlad,

I've updated the code to address the reports that the main window flashes for a few milliseconds before the splash screen appears. I added a note indicating that this can be corrected by setting the main VI to run transparently. To do this, go to VI Properties >> Window Appearance >> Customize. Ensure that  "Window runs transparently" is checked and set the value to 100%.

Thanks again for your help in working to improve this example code.

Mark Ridgley

Member Vladiator
Member

Mark,

It was nice meeting you at the NI User Group meeting last week, and it was a great presentation! Looks like setting the transparency to 100% solves that flickering effect - great job finding the root cause.I believe you polished it perfectly now!

I can add one thing about this code that I love: If you set fade-in/fade-out effect in the code, not only the splash screen will fade in, but when the user exits the app, the main application will fade out! the effect is very cool, I have not seen any application that does that. If you add this to your custom app, this will be very impressive!

Regards,

-Vlad

Member Vladiator
Member

A couple of comments:

1.  If you use panel resizing and scaling in your main window, then you need to use Mark's EXAMPLE4 and also note that two check boxes of Windows Size VI properties of your Main panel shall be _unchecked_, specifically these options:

- Maintain proportions of window for different monitor resolution

- Scale all objects on front panel as the window resizes.

2. If you change software version on the transparent text control, your need to make sure it persists (Make current value default), Otherwise when you compile the executible, it will still show the previous version. Ideally the transparent text contol could be changed to an indicator that would show the version of the compiled EXE file.

Active Participant FabiolaDelaCueva Active Participant
Active Participant

Mark,

When I try to extract the zip files I get a prompt for password, I skip them all and of course end up with an empty folder. What should I do with the zip file after I download it. I am using LabVIEW 2012.

Thanks,

Fab

Certified LabVIEW Architect * Certified LabVIEW Embedded Developer * Certified Professional Instructor * LabVIEW Champion
Member Mark.Ridgley Member
Member

Hey, Fabiola


Thanks for downloading my code. I'm sorry to hear about your difficulties trying to extracting the files.


The fact that you are being prompted for a password is odd because I never put passwords on anything that I upload to the community.


Some users have reported issues with long paths when extracting some of my uploads. Could you try extracting the files to C:\ to see if that corrects the issue?

Otherwise, would you be able to post a screen capture of one of the prompts you are seeing so that I can try to figure out what might be happening here?


Thanks,

Mark

Active Participant FabiolaDelaCueva Active Participant
Active Participant

I was beign lazy and just leaving the default directory name when I right clicked on the zip file and selected "Extract all".  Once I changed the directory name it worked.

Here is the image I was getting, in case someone else has this problem in the future:

Password Needed.PNG

Certified LabVIEW Architect * Certified LabVIEW Embedded Developer * Certified Professional Instructor * LabVIEW Champion
Active Participant FabiolaDelaCueva Active Participant
Active Participant

Mark,

This is very nice. Thanks for sharing it with the community.

Regards,

Fab

Certified LabVIEW Architect * Certified LabVIEW Embedded Developer * Certified Professional Instructor * LabVIEW Champion
Member Mark.Ridgley Member
Member

Fabiola,

I'm glad that things worked out for you.

Thanks for the feedback - I really appreciate it.

I'm glad you like the code and I hope you find it useful.

Mark

Member bienieck
Member

Firstly, I would like to say - great piece of code, Mark!

Secondly - I think I noticed some kind of annoying bug. When I run example 5 with transparent ring then I can see all picture ring with black background instead transparent, just in blink of the eye. I found that it is probably connected with time gap between changing front panel window state (prperty node) and for loop in last flat sequence frame in Splash in Main - Set Layered Window Attributes.vi. Any idea how to handle it?

Michał Bieńkowski
CLA, CTD
Member Haiping
Member

Mark,

Thanks for sharing! Really cool~

Member Haiping
Member

And, be careful about the vi window properties settings. For example, the minimum window size.

Member AmitKaria2k
Member

Really cool & nice examples !!

Thanks for sharing the code with community

Active Participant saran1988
Active Participant

Hi i need to splash screen ..

when booting ..

Ans when Panel closing .

How to select two splash screen.

when i try Ctrl shift K .

Active Participant FabiolaDelaCueva Active Participant
Active Participant

Saran1988,

You can find more about Splash screens here: https://decibel.ni.com/content/blogs/labviewramblings/2013/11/30/groovy-splash-screen

as far as the Ctrl + Shift + K, you can try to put a hidden button on your front panel that has the key navigation set to that combination key.

Also, you might get more responses if you ask your question in the forums, I recommend the NI forums and LAVAG:

http://www.ni.com/white-paper/5056/en/

Good luck.

Regards,

Fab

Certified LabVIEW Architect * Certified LabVIEW Embedded Developer * Certified Professional Instructor * LabVIEW Champion
N/A

Sorry about my OOO msg... deleting it

Contributors