From 9f1593aada8f5872136fff74b4c87ed9751bb779 Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Sat, 10 Nov 2007 23:31:30 +0000 Subject: [PATCH] Initial check-in. --- Source/Examples/Utilities.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Source/Examples/Utilities.cs diff --git a/Source/Examples/Utilities.cs b/Source/Examples/Utilities.cs new file mode 100644 index 00000000..f569d1b9 --- /dev/null +++ b/Source/Examples/Utilities.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; + +namespace Examples +{ + public static class Utilities + { + /// + /// Converts a System.Drawing.Color to a System.Int32. + /// + /// The System.Drawing.Color to convert. + /// A System.Int32 containing the R, G, B, A values of the + /// given System.Drawing.Color in the Rbga32 format. + public static int ColorToRgba32(Color c) + { + return (int)((c.A << 24) | (c.B << 16) | (c.G << 8) | c.R); + } + } +}