KsWare.Windows.Display 0.1.0

dotnet add package KsWare.Windows.Display --version 0.1.0
NuGet\Install-Package KsWare.Windows.Display -Version 0.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="KsWare.Windows.Display" Version="0.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add KsWare.Windows.Display --version 0.1.0
#r "nuget: KsWare.Windows.Display, 0.1.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install KsWare.Windows.Display as a Cake Addin
#addin nuget:?package=KsWare.Windows.Display&version=0.1.0

// Install KsWare.Windows.Display as a Cake Tool
#tool nuget:?package=KsWare.Windows.Display&version=0.1.0

KsWare.Windows.Display

This library provides information for displays (screens, monitors). The name is derived von System.Windows.Forms.Screen. This is my implementation targeting WPF.

This is a really early stage of development. But is it usable.

  • You can set the process or thread DPI behavior.
  • You can check if a window fits on the monitor or the whole virtual screen.
  • You can get/set window bounds independed of individual monitor scaling using physical pixal.
  • and of course you can get information about a display (size, position, color depth, scaling factor, DPI)

API

Some API methods do not participate in DPI virtualization. Then the values are always in terms of physical pixels, and is not related to the calling context. In this cases always classes from System.Drawing namespace are used to specify physical pixels. System.Drawing.Rectangle, System.Drawing.Point, System.Drawing.Size.
In all other casses classes from System.Window namespace are used. System.Window.Rect, System.Window.Point, System.Window.Size

DisplayInfo-class

Contains static methods to get instances of DisplayInfo.

The DisplayInfo instance contains information about a specific display/monitor.

WindowExtensions-class

contains "display" specifig extention methods for the Window-class

VirtualScreen-class

Method Description
Bounds Gets the bounds of the virtual screen.
IntersectsWith Determines if the virtual screen bounds intersects with the rectangular region represented by parameter rect.
Contains Determines if the rectangular region represented by parameter rect is entirely contained within the rectangular region represented by the virtual screens bounds

DpiBehavior-class

Gets/Sets DPI awareness context and Dpi hosting behavior.

Naming mismatch

KsWare.Screen assembly and DisplayInfo class
The name "KsWare.Screen" is a working title and subject to change. Microsoft API uses "display". So I named all classes also Display.

KsWare.Windows.Screen assembly and Screen class
One could assume that it is a 1:1 implementation of Winfowms System.Windows.Forms.Screen is, but this is not intended.

KsWare.Windows.Display assembly and DisplayInfo class
This seems to be a good name.

Screen: a flat surface in a cinema, on a television, or as part of a computer, on which pictures or words are shown

Screen In a computer display , the screen is the physical surface on which visual information is presented. This surface is usually made of glass. The screen size is measured from one corner to the opposite corner diagonally.

Display A display is a computer output surface and projecting mechanism that shows text and often graphic images to the computer user, using a cathode ray ...

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net5.0-windows7.0 is compatible.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net6.0-windows7.0 is compatible.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.1 is compatible. 
.NET Framework net452 is compatible.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETCoreApp 3.1

    • No dependencies.
  • .NETFramework 4.5.2

    • No dependencies.
  • .NETFramework 4.8

    • No dependencies.
  • net5.0-windows7.0

    • No dependencies.
  • net6.0-windows7.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.1.0 398 5/24/2022
0.0.1 377 5/22/2022