-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCursorFactory.cs
44 lines (39 loc) · 1.27 KB
/
CursorFactory.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Windows.Forms;
namespace KinectProvider
{
class CursorFactory
{
public static ICursor getCursor(Bitmap defaultCursor)
{
//if (true && isSingleScreen())//if (runOnAtLeastWin8())
//{
// //Another possible cursor, which will even work on Windows 8 Startscreen, but less nice looking if you are not using squared cursors
// //the Win7 compatible cursor is more performant
// //moreover it is only working on one screen!!!
// return new Cursor(defaultCursor);
//}
//else
//{
return new DebugCursor(defaultCursor);
//}
}
private static Boolean isSingleScreen()
{
return Screen.AllScreens.GetUpperBound(0) == 0;
}
private static Boolean runOnAtLeastWin8()
{
//Get Operating system information.
OperatingSystem os = Environment.OSVersion;
//Get version information about the os.
Version vs = os.Version;
//Win8 is 6.2
return vs.Major > 5 && vs.Minor > 1;
}
}
}