Click here to Skip to main content
11,578,739 members (65,259 online)
Click here to Skip to main content
Add your own
alternative version

A complete C# Screensaver that does double-buffering on multiple monitor systems!

, 24 Jun 2005 202.5K 1.4K 189
Example screensaver in source code. Does a mini-preview too!
swarmscreensaver_src.zip
SwarmScreenSaver
CodeCommentReport
CommonCode
Insects
SwarmScreenSaver
CommonCode
Insects
SwarmScreenSaver
banner.jpg
darkcorner.jpg
gradleft.jpg
gradtop.jpg
graycorner.jpg
minus.jpg
plus.jpg
titletile.jpg
App.ico
SwarmScreenSaver.csproj.user
<!-- saved from url=(0014)about:Swarm -->
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>CommonCode.CommonFunctions</TITLE>
<LINK REL=STYLESHEET HREF="../CommentReport.css" TYPE="text/css">
</HEAD>
<BODY topmargin=0 rightmargin=0 leftmargin=0 style="background-image: url(../titletile.jpg); background-repeat:repeat-x; background-position: 0 0;" >
<DIV CLASS="PageHeading">CommonCode.CommonFunctions Class</DIV>
<DIV CLASS="Description">

A class of commonly used functions: Custom random number generators and a random RGB color method.<br></br>
This class needs no constructor.
<P>

</DIV>
<IMG src="../GradLeft.jpg" width=7 height=378 alt="" border="0" style="position:absolute; left:10; top:18;z-Index:2">
<IMG src="../GradTop.jpg" width=352 height=7 alt="" border="0" align="top" style="position:absolute; left:10; top:18; z-index:1">
<DIV CLASS="Remarks">
<SPAN CLASS="RemarkHdrX">Access: </SPAN>Public</DIV>
<DIV CLASS="Remarks">
<SPAN CLASS="RemarkHdrX">Base Classes: </SPAN>Object</DIV>
<TABLE CLASS="InfoTable" cellpadding=0 cellspacing=0>
<TR height=20>
<TD width=20>&nbsp;</TD>
<TD valign=top align=left width=9 bgcolor="#cccc66"><IMG SRC="../graycorner.jpg" align=top></TD>
<TD CLASS="TableLightLabel" WIDTH=206>Members</TD>
<TD CLASS="TableLightLabel" >Description</TD>
<TD width=20>&nbsp;</TD>
</TR>
<TR height=20>
<TD width=20>&nbsp;</TD>
<TD CLASS="TableLightDesc">&nbsp;</TD>
<TD CLASS="TableLightDesc"><A HREF="CWP131.HTM" TARGET="CNTFRAME">IsWindowVisible</A></TD>
<TD CLASS="TableLightDesc">&nbsp;</TD>
<TD width=20>&nbsp;</TD>
</TR><TR height=20>
<TD width=20>&nbsp;</TD>
<TD CLASS="TableLightDesc">&nbsp;</TD>
<TD CLASS="TableLightDesc"><A HREF="CWP132.HTM" TARGET="CNTFRAME">GetClientRect</A></TD>
<TD CLASS="TableLightDesc">
Declare an external API function call. A wrapper function calls this.
<P>
</TD>
<TD width=20>&nbsp;</TD>
</TR><TR height=20>
<TD width=20>&nbsp;</TD>
<TD CLASS="TableLightDesc">&nbsp;</TD>
<TD CLASS="TableLightDesc"><A HREF="CWP134.HTM" TARGET="CNTFRAME">IsWindowVisibleApi</A></TD>
<TD CLASS="TableLightDesc">
Wrapper to call the IsWindowVisible api call.
<P>
</TD>
<TD width=20>&nbsp;</TD>
</TR><TR height=20>
<TD width=20>&nbsp;</TD>
<TD CLASS="TableLightDesc">&nbsp;</TD>
<TD CLASS="TableLightDesc"><A HREF="CWP135.HTM" TARGET="CNTFRAME">GetClientRectApi</A></TD>
<TD CLASS="TableLightDesc">
Wrapper to call GetClientRect API functions in user32.dll to get size of the client area of a window.
<P>
</TD>
<TD width=20>&nbsp;</TD>
</TR><TR height=20>
<TD width=20>&nbsp;</TD>
<TD CLASS="TableLightDesc">&nbsp;</TD>
<TD CLASS="TableLightDesc"><A HREF="CWP136.HTM" TARGET="CNTFRAME">RandIntGenerator</A></TD>
<TD CLASS="TableLightDesc">
A private instance of a random number generator for use by all functions in this class.
<P>
</TD>
<TD width=20>&nbsp;</TD>
</TR><TR height=20>
<TD width=20>&nbsp;</TD>
<TD CLASS="TableLightDesc">&nbsp;</TD>
<TD CLASS="TableLightDesc"><A HREF="CWP137.HTM" TARGET="CNTFRAME">rand</A></TD>
<TD CLASS="TableLightDesc">
Returns a non-negative integer between 0 and 32767 inclusive.
<P>
</TD>
<TD width=20>&nbsp;</TD>
</TR><TR height=20>
<TD width=20>&nbsp;</TD>
<TD CLASS="TableLightDesc">&nbsp;</TD>
<TD CLASS="TableLightDesc"><A HREF="CWP138.HTM" TARGET="CNTFRAME">RAND</A></TD>
<TD CLASS="TableLightDesc">
Returns an Int that seems to be in the range of approximately -(v/2)+1 to (v/2)-1 
<P>
</TD>
<TD width=20>&nbsp;</TD>
</TR><TR height=20>
<TD width=20>&nbsp;</TD>
<TD CLASS="TableLightDesc">&nbsp;</TD>
<TD CLASS="TableLightDesc"><A HREF="CWP139.HTM" TARGET="CNTFRAME">randInRange</A></TD>
<TD CLASS="TableLightDesc">
Returns an integer in the range of MinVal to MaxVal inclusive.
<P>
</TD>
<TD width=20>&nbsp;</TD>
</TR><TR height=20>
<TD width=20>&nbsp;</TD>
<TD CLASS="TableLightDesc">&nbsp;</TD>
<TD CLASS="TableLightDesc"><A HREF="CWP140.HTM" TARGET="CNTFRAME">ConvertHSBToRGB</A></TD>
<TD CLASS="TableLightDesc">
Convert an HSB to RGB color. Thanks to George Shepherd's site..
http://www.syncfusion.com/FAQ/WindowsForms/FAQ_c85c.aspx#q982q
<P>
</TD>
<TD width=20>&nbsp;</TD>
</TR><TR height=20>
<TD width=20>&nbsp;</TD>
<TD CLASS="TableLightDesc">&nbsp;</TD>
<TD CLASS="TableLightDesc"><A HREF="CWP141.HTM" TARGET="CNTFRAME">AdjustForeColorBrightnessForBackColor</A></TD>
<TD CLASS="TableLightDesc">&nbsp;</TD>
<TD width=20>&nbsp;</TD>
</TR></TABLE>
</BODY>
</HTML>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Garry Freemyer
Web Developer
United States United States
Hello, I have been a professional hairpuller aka programmer for a large company during the last nine years. The acquiring company is closing down the california office so I'll be out of work at the end of June at the latest. I program in a variety of laguages, C#, C++, C, Visual Basic, SQl Server among others. I live north of Sacramento in Paradise CA. I've been programming since the early 1980 and people accuse me of going bald. I'm not going bald, my hair is just migrating south and into my ears.

I am a firm believer that the most widely used programming language is #$@$@$%#$%^ but folks tend to object to the unusual synatax where each word has a colorful meaning and sentences are limited to three words max, while the punching bag flys back and forth so fast it heats up from friction like a meteorite through the air.

In short, I'm nuts, but I'm good at what I do.

Programming is like beating my head against a brick wall, it hurts so bad I can't stand it, but when I stop beating my head against the wall (Solve the problem), it feels so good I gotta do it again!

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150603.1 | Last Updated 24 Jun 2005
Article Copyright 2005 by Garry Freemyer
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid