├── Images ├── Browser.png ├── OpenScreenApp.png └── OpenScreenIcon.ico ├── OpenScreen ├── favicon.ico ├── Resources │ └── favicon.ico ├── App.xaml ├── App.xaml.cs ├── Properties │ ├── Settings.settings │ ├── Settings.Designer.cs │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── App.config ├── UiConstants.cs ├── OpenScreen.xaml ├── OpenScreen.csproj └── OpenScreen.xaml.cs ├── OpenScreen.Core ├── Screenshot │ ├── Fps.cs │ ├── Resolution.cs │ ├── WinFeatures │ │ ├── ApplicationWindow.cs │ │ ├── MouseCursor.cs │ │ └── RunningApplications.cs │ └── Screenshot.cs ├── Server │ ├── ServerConfig.cs │ ├── ServerSocketExtension.cs │ └── StreamingServer.cs ├── Mjpeg │ ├── MjpegConstants.cs │ ├── MjpegStream.cs │ └── MjpegWriter.cs ├── Properties │ └── AssemblyInfo.cs └── OpenScreen.Core.csproj ├── LICENSE ├── OpenScreen.sln ├── README.md ├── .gitignore └── OpenScreen.Installer └── OpenScreen.Installer.vdproj /Images/Browser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrKonstantinSh/OpenScreen/HEAD/Images/Browser.png -------------------------------------------------------------------------------- /OpenScreen/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrKonstantinSh/OpenScreen/HEAD/OpenScreen/favicon.ico -------------------------------------------------------------------------------- /Images/OpenScreenApp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrKonstantinSh/OpenScreen/HEAD/Images/OpenScreenApp.png -------------------------------------------------------------------------------- /Images/OpenScreenIcon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrKonstantinSh/OpenScreen/HEAD/Images/OpenScreenIcon.ico -------------------------------------------------------------------------------- /OpenScreen/Resources/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrKonstantinSh/OpenScreen/HEAD/OpenScreen/Resources/favicon.ico -------------------------------------------------------------------------------- /OpenScreen/App.xaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /OpenScreen.Core/Screenshot/Fps.cs: -------------------------------------------------------------------------------- 1 | namespace OpenScreen.Core.Screenshot 2 | { 3 | /// 4 | /// Provides an enumeration of the possible number of frames per second. 5 | /// 6 | public enum Fps 7 | { 8 | OneHundredAndTwenty = 8, 9 | Sixty = 16, 10 | Thirty = 33, 11 | Fifteen = 66 12 | } 13 | } -------------------------------------------------------------------------------- /OpenScreen/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | 9 | namespace OpenScreen 10 | { 11 | /// 12 | /// Interaction logic for App.xaml 13 | /// 14 | public partial class App : Application 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /OpenScreen.Core/Server/ServerConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Net; 2 | 3 | namespace OpenScreen.Core.Server 4 | { 5 | internal class ServerConfig 6 | { 7 | public IPAddress IpAddress { get; } 8 | 9 | public int Port { get; } 10 | 11 | public ServerConfig(IPAddress ipAddress, int port) 12 | { 13 | IpAddress = ipAddress; 14 | Port = port; 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /OpenScreen/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3030 10 | 11 | 12 | -------------------------------------------------------------------------------- /OpenScreen.Core/Server/ServerSocketExtension.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Net.Sockets; 3 | 4 | namespace OpenScreen.Core.Server 5 | { 6 | /// 7 | /// Provides an enumerated connection in an enumerated form. 8 | /// 9 | internal static class ServerSocketExtension 10 | { 11 | /// 12 | /// Provides an enumerated connection in an enumerated form. 13 | /// 14 | /// Server socket. 15 | /// An enumerated connection in an enumerated form. 16 | public static IEnumerable GetIncomingConnections(this Socket server) 17 | { 18 | while (true) 19 | { 20 | yield return server.Accept(); 21 | } 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /OpenScreen.Core/Mjpeg/MjpegConstants.cs: -------------------------------------------------------------------------------- 1 | namespace OpenScreen.Core.Mjpeg 2 | { 3 | /// 4 | /// Provides request and response headers. 5 | /// 6 | internal static class MjpegConstants 7 | { 8 | public const string ResponseHeaders = 9 | "HTTP/1.1 200 OK\nContent-Type: multipart/x-mixed-replace; boundary=--boundary\n"; 10 | public const string NewLine = "\n"; 11 | 12 | /// 13 | /// Provides headers with information about the transmitted images. 14 | /// 15 | /// The length of the transmitted content. 16 | /// A string of headers. 17 | public static string GetImageInfoHeaders(long contentLength) 18 | { 19 | return $"\n--boundary\nContent-Type: image/jpeg\nContent-Length: {contentLength}\n\n"; 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /OpenScreen/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 3030 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /OpenScreen.Core/Mjpeg/MjpegStream.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Drawing; 3 | using System.IO; 4 | 5 | namespace OpenScreen.Core.Mjpeg 6 | { 7 | /// 8 | /// Allows to work with the streams of images presented in MJPEG format. 9 | /// 10 | internal static class MjpegStream 11 | { 12 | /// 13 | /// Provides an enumerated streams of images represented in MJPEG format. 14 | /// 15 | /// Images to save to the streams. 16 | /// An enumerated streams of images represented in MJPEG format. 17 | internal static IEnumerable GetMjpegStream(this IEnumerable images) 18 | { 19 | using var memoryStream = new MemoryStream(); 20 | 21 | foreach (var image in images) 22 | { 23 | memoryStream.SetLength(0); 24 | image.Save(memoryStream, System.Drawing.Imaging.ImageFormat.Jpeg); 25 | 26 | yield return memoryStream; 27 | } 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Konstantin Shulga 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /OpenScreen.Core/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("OpenScreen.Core")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("OpenScreen.Core")] 12 | [assembly: AssemblyCopyright("Copyright © 2020")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("666657b0-cde6-4274-bd25-3e72a1fb87fb")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /OpenScreen.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30011.22 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenScreen.Core", "OpenScreen.Core\OpenScreen.Core.csproj", "{666657B0-CDE6-4274-BD25-3E72A1FB87FB}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenScreen", "OpenScreen\OpenScreen.csproj", "{B088B160-DBC1-484C-BEF7-62BF5F15BC98}" 9 | EndProject 10 | Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "OpenScreen.Installer", "OpenScreen.Installer\OpenScreen.Installer.vdproj", "{FB3B3370-2C47-424F-9001-2642A031B475}" 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|Any CPU = Debug|Any CPU 15 | Release|Any CPU = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {666657B0-CDE6-4274-BD25-3E72A1FB87FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {666657B0-CDE6-4274-BD25-3E72A1FB87FB}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {666657B0-CDE6-4274-BD25-3E72A1FB87FB}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {666657B0-CDE6-4274-BD25-3E72A1FB87FB}.Release|Any CPU.Build.0 = Release|Any CPU 22 | {B088B160-DBC1-484C-BEF7-62BF5F15BC98}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {B088B160-DBC1-484C-BEF7-62BF5F15BC98}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {B088B160-DBC1-484C-BEF7-62BF5F15BC98}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {B088B160-DBC1-484C-BEF7-62BF5F15BC98}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {FB3B3370-2C47-424F-9001-2642A031B475}.Debug|Any CPU.ActiveCfg = Debug 27 | {FB3B3370-2C47-424F-9001-2642A031B475}.Release|Any CPU.ActiveCfg = Release 28 | EndGlobalSection 29 | GlobalSection(SolutionProperties) = preSolution 30 | HideSolutionNode = FALSE 31 | EndGlobalSection 32 | GlobalSection(ExtensibilityGlobals) = postSolution 33 | SolutionGuid = {BAA0F3D7-7F65-4C59-B549-88765170BA85} 34 | EndGlobalSection 35 | EndGlobal 36 | -------------------------------------------------------------------------------- /OpenScreen/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace OpenScreen.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | 26 | [global::System.Configuration.UserScopedSettingAttribute()] 27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 28 | [global::System.Configuration.DefaultSettingValueAttribute("")] 29 | public string IpAddress { 30 | get { 31 | return ((string)(this["IpAddress"])); 32 | } 33 | set { 34 | this["IpAddress"] = value; 35 | } 36 | } 37 | 38 | [global::System.Configuration.UserScopedSettingAttribute()] 39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 40 | [global::System.Configuration.DefaultSettingValueAttribute("3030")] 41 | public string Port { 42 | get { 43 | return ((string)(this["Port"])); 44 | } 45 | set { 46 | this["Port"] = value; 47 | } 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /OpenScreen.Core/Mjpeg/MjpegWriter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Text; 4 | 5 | namespace OpenScreen.Core.Mjpeg 6 | { 7 | /// 8 | /// Provides a stream writer that can be used to write images as MJPEG 9 | /// to any stream. 10 | /// 11 | internal class MjpegWriter : IDisposable 12 | { 13 | private Stream _stream; 14 | 15 | /// 16 | /// The constructor of the class that initializes the fields of the class. 17 | /// 18 | public MjpegWriter(Stream stream) 19 | { 20 | _stream = stream; 21 | } 22 | 23 | /// 24 | /// Writes response headers to a stream. 25 | /// 26 | public void WriteHeaders() 27 | { 28 | var headers = Encoding.ASCII.GetBytes(MjpegConstants.ResponseHeaders); 29 | 30 | const int offset = 0; 31 | _stream.Write(headers, offset, headers.Length); 32 | 33 | _stream.Flush(); 34 | } 35 | 36 | /// 37 | /// Writes an image to a stream. 38 | /// 39 | /// Stream of images. 40 | public void WriteImage(MemoryStream imageStream) 41 | { 42 | var headers = Encoding.ASCII.GetBytes( 43 | MjpegConstants.GetImageInfoHeaders(imageStream.Length)); 44 | 45 | const int offset = 0; 46 | _stream.Write(headers, offset, headers.Length); 47 | 48 | imageStream.WriteTo(_stream); 49 | 50 | var endOfResponse = Encoding.ASCII.GetBytes(MjpegConstants.NewLine); 51 | 52 | _stream.Write(endOfResponse, offset, endOfResponse.Length); 53 | 54 | _stream.Flush(); 55 | } 56 | 57 | /// 58 | /// The implementation of the IDisposable interface. 59 | /// 60 | public void Dispose() 61 | { 62 | try 63 | { 64 | _stream?.Dispose(); 65 | } 66 | finally 67 | { 68 | _stream = null; 69 | } 70 | } 71 | } 72 | } -------------------------------------------------------------------------------- /OpenScreen/UiConstants.cs: -------------------------------------------------------------------------------- 1 | namespace OpenScreen 2 | { 3 | internal static class UiConstants 4 | { 5 | #region Connected users info 6 | 7 | public const string ConnectedUsersZero = "Connected users: 0"; 8 | public const string ConnectedUsers = "Connected users: "; 9 | 10 | #endregion 11 | 12 | #region Start / stop button 13 | 14 | public const string StartStream = "Start stream"; 15 | public const string StopStream = "Stop stream"; 16 | 17 | #endregion 18 | 19 | #region Ignored apps 20 | 21 | public const string MicrosoftTextInputApp = "Microsoft Text Input Application"; 22 | 23 | #endregion 24 | 25 | #region Errors 26 | 27 | public const string ErrorTitle = "Error"; 28 | public const string PortOrIpErrorMessage = "Enter the correct port and IP address."; 29 | public const string IpAddressErrorMessage = "Enter the correct IP address."; 30 | 31 | #endregion 32 | 33 | #region Fps 34 | 35 | public const string OneHundredAndTwentyFps = "120 FPS"; 36 | public const string SixtyFps = "60 FPS"; 37 | public const string ThirtyFps = "30 FPS"; 38 | public const string FifteenFps = "15 FPS"; 39 | 40 | #endregion 41 | 42 | #region Resolutions 43 | 44 | public const string OneThousandAndEightyP = "1920x1080 (1080p)"; 45 | public const string SevenHundredAndTwentyP = "1280x720 (720p)"; 46 | public const string FourHundredAndEightyP = "854x480 (480p)"; 47 | public const string ThreeHundredAndSixtyP = "480x360 (360p)"; 48 | public const string TwoHundredAndFortyP = "352x240 (240p)"; 49 | 50 | #endregion 51 | 52 | #region Server information 53 | 54 | public const string NewLine = "\n"; 55 | public const string ServerConfiguration = "Server Configuration...\n"; 56 | public const string StartingServer = "Starting the server...\n"; 57 | public const string ServerIsStarted = "The server is started at the following address: "; 58 | public const string ServerStop = "Server Stop...\n"; 59 | public const string ServerIsStopped = "The server is stopped.\n"; 60 | 61 | #endregion 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /OpenScreen/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("OpenScreen")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("OpenScreen")] 15 | [assembly: AssemblyCopyright("Copyright © 2020")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | //In order to begin building localizable applications, set 25 | //CultureYouAreCodingWith in your .csproj file 26 | //inside a . For example, if you are using US english 27 | //in your source files, set the to en-US. Then uncomment 28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 29 | //the line below to match the UICulture setting in the project file. 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 36 | //(used if a resource is not found in the page, 37 | // or application resource dictionaries) 38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 39 | //(used if a resource is not found in the page, 40 | // app, or any theme specific resource dictionaries) 41 | )] 42 | 43 | 44 | // Version information for an assembly consists of the following four values: 45 | // 46 | // Major Version 47 | // Minor Version 48 | // Build Number 49 | // Revision 50 | // 51 | // You can specify all the values or you can default the Build and Revision Numbers 52 | // by using the '*' as shown below: 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /OpenScreen.Core/Screenshot/Resolution.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | 4 | namespace OpenScreen.Core.Screenshot 5 | { 6 | /// 7 | /// Provides methods for working with image resolutions. 8 | /// 9 | public static class Resolution 10 | { 11 | #region Screen resolutions 12 | 13 | private const int OneThousandAndEightyPWidth = 1920; 14 | private const int OneThousandAndEightyPHeight = 1080; 15 | 16 | private const int SevenHundredAndTwentyPWidth = 1080; 17 | private const int SevenHundredAndTwentyPHeight = 720; 18 | 19 | private const int FourHundredAndEightyPWidth = 854; 20 | private const int FourHundredAndEightyPHeight = 480; 21 | 22 | private const int ThreeHundredAndSixtyPWidth = 480; 23 | private const int ThreeHundredAndSixtyPHeight = 360; 24 | 25 | private const int TwoHundredAndFortyPWidth = 352; 26 | private const int TwoHundredAndFortyPHeight = 240; 27 | 28 | #endregion 29 | 30 | /// 31 | /// Possible screen resolutions. 32 | /// 33 | public enum Resolutions 34 | { 35 | OneThousandAndEightyP, 36 | SevenHundredAndTwentyP, 37 | FourHundredAndEightyP, 38 | ThreeHundredAndSixtyP, 39 | TwoHundredAndFortyP 40 | } 41 | 42 | /// 43 | /// Provides width and height for the required screen resolution. 44 | /// 45 | /// The resolution of the screen whose size you need to know. 46 | /// Width and height of resolution. 47 | public static Size GetResolutionSize(Resolutions resolution) 48 | { 49 | return resolution switch 50 | { 51 | Resolutions.OneThousandAndEightyP => new Size(OneThousandAndEightyPWidth, OneThousandAndEightyPHeight), 52 | Resolutions.SevenHundredAndTwentyP => new Size(SevenHundredAndTwentyPWidth, 53 | SevenHundredAndTwentyPHeight), 54 | Resolutions.FourHundredAndEightyP => new Size(FourHundredAndEightyPWidth, FourHundredAndEightyPHeight), 55 | Resolutions.ThreeHundredAndSixtyP => new Size(ThreeHundredAndSixtyPWidth, ThreeHundredAndSixtyPHeight), 56 | Resolutions.TwoHundredAndFortyP => new Size(TwoHundredAndFortyPWidth, TwoHundredAndFortyPHeight), 57 | _ => throw new ArgumentOutOfRangeException(nameof(resolution), resolution, null) 58 | }; 59 | } 60 | } 61 | } -------------------------------------------------------------------------------- /OpenScreen/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace OpenScreen.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OpenScreen.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /OpenScreen.Core/OpenScreen.Core.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {666657B0-CDE6-4274-BD25-3E72A1FB87FB} 8 | Library 9 | Properties 10 | OpenScreen.Core 11 | OpenScreen.Core 12 | v4.7.2 13 | 512 14 | true 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | latest 25 | 26 | 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | latest 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /OpenScreen.Core/Screenshot/WinFeatures/ApplicationWindow.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Runtime.InteropServices; 4 | 5 | namespace OpenScreen.Core.Screenshot.WinFeatures 6 | { 7 | /// 8 | /// Provides methods for obtaining information about the application window. 9 | /// 10 | /// Details of the PrintWindow method: 11 | /// https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-printwindow 12 | /// 13 | /// Details of the GetWindowRect method: 14 | /// https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getwindowrect 15 | /// 16 | /// Details of the FindWindow method: 17 | /// https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-findwindowa 18 | /// 19 | internal static class ApplicationWindow 20 | { 21 | internal const uint DrawAllWindow = 0x0; 22 | internal const uint DrawClientOnly = 0x1; 23 | 24 | /// 25 | /// Copies a visual window into the specified device context (DC), typically a printer DC. 26 | /// 27 | /// A handle to the window that will be copied. 28 | /// A handle to the device context. 29 | /// The drawing options. It can be one of the following values. 30 | /// If the function succeeds, it returns a nonzero value. 31 | [DllImport("User32.dll", SetLastError = true)] 32 | [return: MarshalAs(UnmanagedType.Bool)] 33 | internal static extern bool PrintWindow(IntPtr handle, IntPtr deviceContextHandle, uint drawOption); 34 | 35 | /// 36 | /// Retrieves the dimensions of the bounding rectangle of the specified window. 37 | /// The dimensions are given in screen coordinates 38 | /// that are relative to the upper-left corner of the screen. 39 | /// 40 | /// A handle to the window. 41 | /// A pointer to a RECT structure that receives 42 | /// the screen coordinates of the upper-left and 43 | /// lower-right corners of the window. 44 | /// If the function succeeds, the return value is nonzero. 45 | [DllImport("user32.dll")] 46 | internal static extern bool GetWindowRect(IntPtr handle, ref Rectangle screenRectangle); 47 | 48 | /// 49 | /// Retrieves a handle to the top-level window whose class name and 50 | /// window name match the specified strings. This function does not search 51 | /// child windows. This function does not perform a case-sensitive search. 52 | /// 53 | /// The class name or a class atom c 54 | /// created by a previous call to the RegisterClass or RegisterClassEx function. 55 | /// The atom must be in the low-order word of lpClassName; 56 | /// the high-order word must be zero. 57 | /// The window name (the window's title). 58 | /// If this parameter is NULL, all window names match. 59 | /// If the function succeeds, the return value is a handle 60 | /// to the window that has the specified class name and window name. 61 | [DllImport("user32.dll", SetLastError = true)] 62 | internal static extern IntPtr FindWindow(string lpClassName, string lpWindowName); 63 | } 64 | } -------------------------------------------------------------------------------- /OpenScreen.Core/Screenshot/WinFeatures/MouseCursor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace OpenScreen.Core.Screenshot.WinFeatures 5 | { 6 | /// 7 | /// Class for working with the mouse cursor. 8 | /// 9 | /// Details of the CursorInfo structure: 10 | /// https://docs.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-cursorinfo 11 | /// 12 | /// Details of the GetCursorInfo method: 13 | /// https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getcursorinfo 14 | /// 15 | /// Details of the DrawIconEx method: 16 | /// https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-drawiconex 17 | /// 18 | internal static class MouseCursor 19 | { 20 | public const int CursorShowing = 0x00000001; 21 | public const int DiNormal = 0x0003; 22 | 23 | /// 24 | /// Contains global cursor information. 25 | /// 26 | [StructLayout(LayoutKind.Sequential)] 27 | public struct CursorInfo 28 | { 29 | public int cbSize; // The size of the structure, in bytes. 30 | public int flags; // The cursor state. 31 | public IntPtr hCursor; // A handle to the cursor. 32 | public PointApi ptScreenPos; // Screen coordinates of the cursor. 33 | } 34 | 35 | /// 36 | /// Defines the x- and y- coordinates of a point. 37 | /// 38 | [StructLayout(LayoutKind.Sequential)] 39 | public struct PointApi 40 | { 41 | public int x; 42 | public int y; 43 | } 44 | 45 | /// 46 | /// Retrieves information about the global cursor. 47 | /// 48 | /// A pointer to a CURSORINFO structure that receives the information. 49 | /// If the function succeeds, the return value is nonzero. 50 | [DllImport("user32.dll")] 51 | public static extern bool GetCursorInfo(out CursorInfo pci); 52 | 53 | /// 54 | /// Draws an icon or cursor into the specified device context, 55 | /// performing the specified raster operations, 56 | /// and stretching or compressing the icon or cursor as specified. 57 | /// 58 | /// A handle to the device context into which the icon or cursor will be drawn. 59 | /// The logical x-coordinate of the upper-left corner of the icon or cursor. 60 | /// The logical y-coordinate of the upper-left corner of the icon or cursor. 61 | /// A handle to the icon or cursor to be drawn. 62 | /// The logical width of the icon or cursor. 63 | /// The logical height of the icon or cursor. 64 | /// The index of the frame to draw, if hIcon identifies an animated cursor. 65 | /// A handle to a brush that the system uses for flicker-free drawing. 66 | /// The drawing flags. 67 | /// If the function succeeds, the return value is nonzero. 68 | [DllImport("user32.dll")] 69 | public static extern bool DrawIconEx(IntPtr hdc, int xLeft, int yTop, 70 | IntPtr hIcon, int cxWidth, int cyHeight, int istepIfAniCur, 71 | IntPtr hbrFlickerFreeDraw, int diFlags); 72 | } 73 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Contributors][contributors-shield]][contributors-url] 2 | [![Forks][forks-shield]][forks-url] 3 | [![Stargazers][stars-shield]][stars-url] 4 | [![Issues][issues-shield]][issues-url] 5 | [![MIT License][license-shield]][license-url] 6 | 7 | 8 | 9 |
10 |

11 | 12 | Logo 13 | 14 | 15 |

OpenScreen

16 | 17 |

18 | Desktop application for screen sharing over the network! 19 |
20 |
21 | Releases 22 | · 23 | Report Bug 24 | · 25 | Request Feature 26 |

27 |

28 | 29 | 30 | 31 | ## Table of Contents 32 | 33 | * [About the Project](#about-the-project) 34 | * [Built With](#built-with) 35 | * [Getting Started](#getting-started) 36 | * [Installation](#installation) 37 | * [Roadmap](#roadmap) 38 | * [Contributing](#contributing) 39 | * [License](#license) 40 | * [Contact](#contact) 41 | 42 | 43 | 44 | ## About The Project 45 | Screenshots of a running application: 46 | 47 |

48 | OpenScreenApp 49 | Browser 50 |

51 | 52 | **OpenScreen** is a desktop application that allows you to show your screen to friends and colleagues. 53 | 54 | **Features:** 55 | * You can show the whole screen 56 | * You can show the window of a specific application 57 | * You are viewing a demo in a browser -> you can do it from a computer, tablet or phone 58 | * You can enable/disable the display of the cursor when demonstrating the screen/application window 59 | * You can choose the quality of the screen demonstration 60 | * You can change the FPS 61 | 62 | ### Built With 63 | * [Visual Studio 2019](https://visualstudio.microsoft.com/vs/) 64 | * [.NET Framework 4.7.2](https://dotnet.microsoft.com/download/dotnet-framework/net472) 65 | * [C# 7.3](https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-7-3) 66 | 67 | 68 | 69 | ## Getting Started 70 | 71 | ### Installation 72 | 73 | 1. Clone the repo 74 | ```sh 75 | > git clone https://github.com/MrKonstantinSh/OpenScreen.git 76 | ``` 77 | 2. Go to the project folder 78 | ```sh 79 | > cd ./ProjectFolder 80 | ``` 81 | 82 | **OR** 83 | 84 | DOWNLOAD [OpenScreen-Installer.msi](https://github.com/MrKonstantinSh/OpenScreen/releases/download/v1.2/OpenScreen-Installer.msi) 85 | 86 | 87 | ## Roadmap 88 | 89 | See the [open issues](https://github.com/MrKonstantinSh/OpenScreen/issues) for a list of proposed features (and known issues). 90 | 91 | 92 | 93 | ## Contributing 94 | 95 | Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**. 96 | 97 | 1. Fork the Project 98 | 2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`) 99 | 3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`) 100 | 4. Push to the Branch (`git push origin feature/AmazingFeature`) 101 | 5. Open a Pull Request 102 | 103 | 104 | 105 | ## License 106 | 107 | Distributed under the MIT License. See [LICENSE](https://github.com/MrKonstantinSh/OpenScreen/blob/master/LICENSE) for more information. 108 | 109 | 110 | 111 | ## Contact 112 | 113 | Shulga Konstantin - mrkonstantinsh@gmail.com 114 | 115 | Project Link: [https://github.com/MrKonstantinSh/OpenScreen](https://github.com/MrKonstantinSh/OpenScreen) 116 | 117 | 118 | [contributors-shield]: https://img.shields.io/github/contributors/MrKonstantinSh/OpenScreen.svg?style=flat-square 119 | [contributors-url]: https://github.com/MrKonstantinSh/OpenScreen/graphs/contributors 120 | [forks-shield]: https://img.shields.io/github/forks/MrKonstantinSh/OpenScreen.svg?style=flat-square 121 | [forks-url]: https://github.com/MrKonstantinSh/OpenScreen/network/members 122 | [stars-shield]: https://img.shields.io/github/stars/MrKonstantinSh/OpenScreen.svg?style=flat-square 123 | [stars-url]: https://github.com/MrKonstantinSh/OpenScreen/stargazers 124 | [issues-shield]: https://img.shields.io/github/issues/MrKonstantinSh/OpenScreen.svg?style=flat-square 125 | [issues-url]: https://github.com/MrKonstantinSh/OpenScreen/issues 126 | [license-shield]: https://img.shields.io/github/license/MrKonstantinSh/OpenScreen.svg?style=flat-square 127 | [license-url]: https://github.com/MrKonstantinSh/OpenScreen/blob/master/LICENSE 128 | 129 | -------------------------------------------------------------------------------- /OpenScreen/OpenScreen.xaml: -------------------------------------------------------------------------------- 1 | 10 | 11 |