Creating an animated splash screen like office 2010

后端 未结 6 1705
醉酒成梦
醉酒成梦 2021-02-19 09:10

How can I create an animated splash screen like the one in Office 2010 using C#?

相关标签:
6条回答
  • 2021-02-19 09:18

    I recommend using WPF for modern application design and your splashscreen problem.
    Expression Blend is a nice tool for creating animations and xaml designs. But you can also design animations by writing plain xaml as well

    Expression Blend Tutorials
    Animation Using Expression Blend: How to create an animation
    Animation Using Expression Blend: How to start animations on events

    MSDN Info
    Animation Overview

    Using Winforms it will be much mor compicated. The entire GUI is rendered by the CPU (no GPU support) but u can create a custom usercontrol and overwrite the Paint event and use GDI for drawing, but this will be much more complicated then using wpf.

    0 讨论(0)
  • 2021-02-19 09:24

    In WPF it is very easy just right click on project > add new item > splash screen. This

    is simple example explaining it.

    0 讨论(0)
  • 2021-02-19 09:27

    if you want to make a dynamic animated splash screen like Office 2010 , i recommend you to use WPF and never think about WinForms to make dynamic animation with code !

    but if you are determined of using WinForms you have to be tricky , and use one of this tricks :

    • put a Flash ActiveX Object , and make your animation with Flash then link them together

    • if you are good with WPF and Silverlight you can make your animation with Silverlight and view it in a WebBrowser Control , You may also use Flash or HTML5

    0 讨论(0)
  • 2021-02-19 09:28

    Is this question about winforms or wpf?

    If it's about wpf:

    An animated splash screen is not more than a wpf window showing while your "Main Window" is loading. You can design this splash window with Expression Blend as explained by wischi.

    You can also have a look at this code project.

    For creating some kind of a loading animation: A Simple WPF Loading Animation

    Just create a window with an animation defined in xaml and show it while your application is loading -> animated splash screen.

    In Winforms:

    You may have to override the paint method of a form to create an animation. But it's still showing another window which contains an animation while another window is loading.

    0 讨论(0)
  • 2021-02-19 09:29

    A detailed guide for a splashscreen is here: eExample splashscreen

    Another example

    Although the basics is:

    1) Create a splashscreen, show it, close/dispose it

        private void SplashForm()
        {
        SplashForm newSplashForm = new SplashForm();
        newSplashForm.ShowDialog();
        newSplashForm.Dispose();
        }
    

    2) Run the splashscreen on a seperate thread/backgroundworker

            Thread t1 = new Thread(new ThreadStart(SplashForm));
            t1.Start();
            Thread.Sleep(5000); // 5 seconds
            t1.Abort();
            Thread.Sleep(1000);
    
    0 讨论(0)
  • 2021-02-19 09:35

    In Winforms, the simplest way is using a PictureBox with an animated Gif on a splashscreen.

    This way allows you to spend more time on your animation than your code.

    0 讨论(0)
提交回复
热议问题