Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Screensavers With XNA and .NET?

I'm fairly sure you can create screensavers with.NET but are there any tutorials on doing so? and how well can you make XNA screensavers?

like image 381
RCIX Avatar asked Sep 02 '09 05:09

RCIX


People also ask

How do I make a screensaver for Windows?

All screensavers have an .scr extension. Compile your code and change the .exe to .scr. Windows will recognize this as a screensaver. The last step is installation. To install your new screensaver, copy it somewhere outside of your source tree.

How do I add a screensaver to Visual Studio Code?

Now, if you press F5 in VisualStudio you’ll see your screensaver. There are a few remaining housekeeping issues. All screensavers have an .scr extension. Compile your code and change the .exe to .scr. Windows will recognize this as a screensaver.

How does the screensaver work?

The screensaver work is done in a Window.Loaded event. The screen maximization and animation start needs to be triggered after the windows has been loaded. All UI elements have a RenderTransform property which takes transformation objects such as TranslateTransform.

Is there a screensaver for the mainwindow?

The MainWindow window is my actual screensaver. I set two events on the screensaver which close the windows in the event of a mouse or key event. There’s only a grid with my logo image.


2 Answers

A screensaver is just an executable named that has been renamed '.scr' :) So yes, you can make one in whatever language you like, pretty much.

like image 123
Noon Silk Avatar answered Nov 02 '22 01:11

Noon Silk


Here's a nice and small tutorial that explains how to create a screensaver with C#.

As already mentioned, a screensaver is just an executable with an .scr file extension instead of .exe. Additionally, if you want to create a useful screensaver, you should support these command-line arguments:

/c, /c:HWND, /c HWND: Configuration mode where HWND is the handle to the window that should be used as the parent.
/p, /p HWND: Preview mode where HWND is the handle to the parent window.
/s: Run in full-screen mode

like image 31
Christian Avatar answered Nov 02 '22 00:11

Christian