开发者

Windows Forms advanced visual effects

开发者 https://www.devze.com 2023-01-21 07:57 出处:网络
I have an design idea about the appearence of a small program , which is basically a windows form with a combo and one button.What i would like to do is the following.When i click on the .exe of the p

I have an design idea about the appearence of a small program , which is basically a windows form with a combo and one button.What i would like to do is the following.When i click on the .exe of the program to start it , i would like to have an non-standart start up o开发者_高级运维f the window.To be more specific i will give you an example - i click on the .exe , upon which some dots appear in a random matter all over the screen , after those points appear they start moving in a spiral way so finally they merge into the standart square windows form shape.So my question is - is there a free API or anything similar with the help of which its easily doable or there would be a lot of work needed from myself to create those API's ?

Thanks in advance


This will be extremely difficult to do.

It will also be very annoying for the end-users.


In short I see two options:

  • Render your form to a bitmap and render peices of the bitmap to a full-screen layered window. You'll have to call UpdateLayeredWindow repeatedly to get the animation working but that should be a good lead. I could see getting 10-20 fps with this method.

  • Take a screenshot of the desktop, create a full screen borderless topmost window, render the screenshot, then render your animation on top. This will prevent any other windows from recieving input while the animation is playing.

Either way your users will hate you.


As SLaks has already said, that will be pretty annoying for the end-users.

If you ask whether it is doable, I would say yes, everything is doable in programming, it all depends on the effort you're ready to put into.

As a very simple algorithm, here are some steps I would go through for your achievement:

  1. Create a System.Windows.Forms.Form;
  2. Set Form.ShowInTaskBar= false;
  3. Set the Form.TransparencyKey property;
  4. Set the Form.ControlBox= false;
  5. Set Form.TopMost= true;
  6. Drop a PictureBox control on your Form;
  7. On the Form.Load event, take a screenshot of the current desktop and set it as the image of your PictureBox.
  8. Then, build an animated GIF, and superpose it to your form.

You will most likely appreciate, I guess, the following link which discusses about C# Winforms Animation.

Disclaimer: This is an arbitrary algorithm off the top of my head. Besides, I illustrated the steps I would go through in order to achieve such objective, though I have never ever performed WindowsForms animation.

Althouth this might be cool to program, users are conservatives and "always anxious" about program startups, so, as already mentioned, this might become pretty annoying for the end-users.

I hope this helps you through anyway!

0

精彩评论

暂无评论...
验证码 换一张
取 消