• Introduction
  • Programmer's Guide
  • Technical Articles
  • API Documentation
Search Results for

    Show / Hide Table of Contents
    • ic4
      • BufferPool
      • DeviceEnum
      • DeviceInfo
      • Display
      • DisplayNotation
      • DisplayRenderPosition
      • DisplayStatistics
      • DisplayType
      • EmbeddedDisplay
      • ErrorCode
      • ExternalOpenGLDisplay
      • FloatRepresentation
      • FloatingDisplay
      • FrameMetaData
      • Grabber
      • HandleObject
      • IBufferAllocator
      • IC4Exception
      • IDisplay
      • ImageBuffer
      • ImageBuffer.CopyOptions
      • ImageBufferExtensions
      • ImageBufferExtensionsOpenCvSharp
      • ImageType
      • IntRepresentation
      • Interface
      • Library
      • LogLevel
      • LogTarget
      • PixelFormat
      • PixelFormatExtensions
      • PngCompressionLevel
      • PropBoolean
      • PropCategory
      • PropCommand
      • PropEnumEntry
      • PropEnumeration
      • PropFloat
      • PropId
      • PropIdBoolean
      • PropIdCommand
      • PropIdEnumeration
      • PropIdFloat
      • PropIdInteger
      • PropIdRegister
      • PropIdString
      • PropInteger
      • PropRegister
      • PropString
      • Property
      • PropertyIncrementMode
      • PropertyMap
      • PropertyType
      • PropertyVisibility
      • QueueSink
      • QueueSinkConnectedEventArgs
      • QueueSinkEventArgs
      • QueueSinkQueueSizes
      • Sink
      • SinkMode
      • SinkType
      • SnapSink
      • SnapSinkAllocationStrategy
      • StreamSetupOption
      • StreamStatistics
      • TransportLayerType
      • VersionInfoFlags
      • VideoWriter
      • VideoWriterType

    Class PropInteger

    Integer properties represent a feature whose value is an integer number.

    Inheritance
    object
    HandleObject
    Property
    PropInteger
    Implements
    IDisposable
    Inherited Members
    Property.Notification
    Property.Type
    Property.DisplayName
    Property.Name
    Property.Description
    Property.Tooltip
    Property.Visibility
    Property.IsLocked
    Property.IsLikelyLockedByStream
    Property.IsAvailable
    Property.IsReadonly
    Property.IsSelector
    Property.SelectedProperties
    HandleObject.Dispose(bool)
    HandleObject.Dispose()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: ic4
    Assembly: ic4dotnet.dll
    Syntax
    public class PropInteger : Property, IDisposable
    Remarks

    Common examples for a integer properties are Width or Height.

    An integer property can limit the range of valid values. The range of possible values can be queried by reading Minimum and Maximum.

    The possible values can be further restricted by an increment value or a set of value values. Check IncrementMode, Increment and ValidValueSet for details.

    An integer property property supplies hints that can be useful when creating a user interface:

    • A Representation
    • A Unit

    PropInteger instances are created in multiple ways:

    • By directly querying a PropertyMap for a float property:
      • Find(PropIdInteger)
      • FindInteger(string)
      • TryFind(PropIdInteger, out PropInteger)
      • TryFindInteger(string, out PropInteger)
    • By casting a Property object obtained from one of the functions returning generic property objects:
      • Find(string)
      • TryFind(string, out Property)
      • Features
      • All
      • SelectedProperties

    Properties

    Increment

    The step size for valid values accepted by this integer property

    Declaration
    public long Increment { get; }
    Property Value
    Type Description
    long

    The step size for valid values accepted by this integer property

    Remarks

    The increment restricts the set of valid values for a integer property.

    For example, if the property's minimum value is 0, the maximum is 10, and the increment is 2, 1 is not a valid value for the property

    Accessing Increment will throw an exception if IncrementMode is not equal to Increment.

    Exceptions
    Type Condition
    IC4Exception

    Check ErrorCode and ToString() for details.

    IncrementMode

    Indicates how this float property restricts which values are valid between its minimum and maximum value.

    Declaration
    public PropertyIncrementMode IncrementMode { get; }
    Property Value
    Type Description
    PropertyIncrementMode

    The property's increment mode

    Remarks

    An integer property has 1 of 2 possible increment modes:

    Increment modeDescription
    Increment Only multiples of Increment can be set.
    ValueSet Only values that are part of ValidValueSet can be set.

    Maximum

    The maximum value accepted by this property.

    Declaration
    public long Maximum { get; }
    Property Value
    Type Description
    long

    The maximum value accepted by this property.

    Exceptions
    Type Condition
    IC4Exception

    Check ErrorCode and ToString() for details.

    Minimum

    The minimum value accepted by this property.

    Declaration
    public long Minimum { get; }
    Property Value
    Type Description
    long

    The minimum value accepted by this property.

    Exceptions
    Type Condition
    IC4Exception

    Check ErrorCode and ToString() for details.

    Representation

    The suggested representation for this integer property

    Declaration
    public IntRepresentation Representation { get; }
    Property Value
    Type Description
    IntRepresentation

    The suggested representation for this integer property

    Remarks

    The representation can be used as a hint when creating user interfaces

    Unit

    The unit of this integer property

    Declaration
    public string Unit { get; }
    Property Value
    Type Description
    string

    The unit of this integer property

    Exceptions
    Type Condition
    IC4Exception

    Check ErrorCode and ToString() for details.

    ValidValueSet

    The set of valid values for this property

    Declaration
    public IReadOnlyList<long> ValidValueSet { get; }
    Property Value
    Type Description
    IReadOnlyList<long>

    A list containing the values that are valid for this property

    Remarks

    Accessing Increment will throw an exception if IncrementMode is not equal to ValueSet.

    Exceptions
    Type Condition
    IC4Exception

    Check ErrorCode and ToString() for details.

    Value

    The current value of this property

    The value is only writable is the property's writability is not restricted. See IsLocked, IsReadonly, IsAvailable.

    Declaration
    public long Value { get; set; }
    Property Value
    Type Description
    long

    The current value of this property

    Remarks

    If exceptions are not desired when accessing the value, use TryGetValue(out long) or TrySetValue(long).

    Exceptions
    Type Condition
    IC4Exception

    Check ErrorCode and ToString() for details.

    Methods

    TryGetValue(out long)

    Tries to get the current value of the property.

    Declaration
    public bool TryGetValue(out long val)
    Parameters
    Type Name Description
    long val

    Output parameter receiving the current value of the property on success

    Returns
    Type Description
    bool

    true, if the operation was successful, otherwise false.

    Remarks

    In contrast to reading the Value property directly, this method does not throw an exception in case of an error.

    TrySetValue(long)

    Tries to set the current value of the property.

    Declaration
    public bool TrySetValue(long val)
    Parameters
    Type Name Description
    long val

    The new value

    Returns
    Type Description
    bool

    true, if the operation was successful, otherwise false.

    Remarks

    In contrast to writing the Value property directly, this method does not throw an exception in case of an error.

    Implements

    IDisposable
    In this article
    Copyright ©️ 2024 The Imaging Source Europe GmbH www.theimagingsource.com