How to make a winform open like Mac OS animation?

2019-09-11 13:04发布

问题:

Could any one tell how can I open a form with an animation similar to the one used by Mac-OS launcher. I have seen a few other software doing the same thing. For eg: This youtube video also shows a demo of it (@Time: 20 sec and @Time: 28 sec).

I know of animateWindow API, but I think this is not possible with animateWindow.

Any idea on how to do this?

回答1:

AnimateWindow won't fit the bill.

In my opinion these programs work by

  • Creating a transparent window when needed, while computing icons to display
  • Creating the animation and displaying it on the transparent window device context
  • Handling everything on the window via custom events.

What you need is

  • a comprehensive knowledge of GDI32
  • an equally comprehensive knowledge of those dirty tricks used to create animations programmatically.

I'm sorry, but I think that this is not the kind of topic that can briefly explained on a single answer :-(

Eventually, you need something that augments and extends Windows's native graphic capabilities. There are companies that did this before: IIRC Serif.com did write their own GDI replacement for their DTP programs, and I think that all of these companies that make desktop enhancements did the same (or at least, they know how to squeeze GDI32 capabilities)



回答2:

You could try WPF or SilverLight or mixure of above to meet your requirements.

You can check Good WPF or silverlight windows gadget examples and let me know.