System.Devices.TDeviceInfo.SelectDevices

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

class function SelectDevices(ADeviceClass: TDeviceClass; const APhysicalScreenSize, ALogicalScreenSize: TSize;
APlatform: TOSVersion.TPlatform; APixelsPerInch: Integer; SetThisDevice: Boolean = True): TArray<TDeviceInfo>;

C++

__classmethod System::DynamicArray<TDeviceInfo*> __fastcall SelectDevices(TDeviceClass ADeviceClass, const System::Types::TSize &APhysicalScreenSize, const System::Types::TSize &ALogicalScreenSize, System::Sysutils::TOSVersion::TPlatform APlatform, int APixelsPerInch, bool SetThisDevice = true);

Properties

Type Visibility Source Unit Parent
function public
System.Devices.pas
System.Devices.hpp
System.Devices TDeviceInfo

Description

Returns an array with the existing devices that fit the specified device properties, sorted so that better fits go first.

SelectDevices receives the following parameters:

  • ADeviceClass is the desired device class.
  • APhysicalScreenSize indicates the desired width and height of the physical device screen, in pixels.
  • ALogicalScreenSize indicates the width and height of the logical device screen, in pixels, to find or create an instance of TDeviceInfo and make it the current device if SetThisDevice is True. The specified logical screen size does not affect the returned array of existing devices.
  • APlatform is the desired platform.
  • APixelsPerInch is the number of pixels of screen size that represent an inch in the specified physical screen size.
  • If SetThisDevice is True, SelectDevices changes the current device to either an existing device matching the specified data or a new device that contains the specified data and an empty string as ID. If SetThisDevice is False, SelectDevices makes the current device nil.

SelectDevices uses the values specified for APhysicalScreenSize and APixelsPerInch to calculate the specified physical screen diagonal in inches.

The resulting array contains the following existing devices, in the following order:

  1. The device with the specified platform and device class that has the closest physical screen diagonal and has a maximum physical screen diagonal that is equal or lower than the specified physical screen diagonal, if such a device exists.
  2. The non-exclusive device of each of the remaining device classes that has the specified platform and the closest physical screen diagonal and has a maximum physical screen diagonal that is equal or lower than the specified physical screen diagonal, if such a device exists.
  3. All other non-exclusive devices with the specified platform, sorted by how close their physical screen diagonal is to the specified physical screen diagonal.

See Also