This project has moved. For the latest updates, please go here.

Capability Category

  • BitDepthReductionAttribute - Specifies the Reduction Method the Source should use to reduce the bit depth of the data
[BitDepthReduction(TwBR.Threshold, TwBR.Diffusion)] //ICAP_BITDEPTHREDUCTION
public sealed class ScreenDataSource:BitmapDataSource {
  • CompressionAttribute - Define compression schemes for Buffered Memory and File transfers
[Compression(TwCompression.Jpeg/*,TwCompression.Png, ... */)] //ICAP_COMPRESSION
public sealed class ScreenDataSource:BitmapDataSource {
  • CustHalftoneAttribute - Specifies the square-cell halftone (dithering) matrix the Source should use to halftone the image.
[CustHalftone(...)] //ICAP_CUSTHALFTONE
public sealed class ScreenDataSource:BitmapDataSource {
  • DevicePropertiesAttribute - Define device properties
[DeviceProperties(
    16f, //ICAP_PHYSICALWIDTH
    9f, //ICAP_PHYSICALHEIGHT
    100f, //ICAP_XNATIVERESOLUTION
    100f)] //ICAP_YNATIVERESOLUTION
public sealed class ScreenDataSource:BitmapDataSource {
  • HalftonesAttribute - Define a list of names of the halftone patterns available within the Source
[Halftones("A1","A2","A3")] //ICAP_HALFTONES
public sealed class ScreenDataSource:BitmapDataSource {
  • ImageFileFormatAttribute - Define which file formats the Source can generate
[ImageFileFormat(TwFF.Bmp,TwFF.Tiff,TwFF.Jfif)] //ICAP_IMAGEFILEFORMAT
public sealed class ScreenDataSource:BitmapDataSource {
  • LsbFirstSupportedAttribute - Define that a Source supported LSB (ICAP_BITORDER)
[LsbFirstSupported] //ICAP_BITORDER
public sealed class ScreenDataSource:BitmapDataSource {
  • PixelFlavorAttribute - Define sense of the pixel whose numeric value is zero (minimum data value)
[PixelFlavor(TwPF.Chocolate)] //ICAP_PIXELFLAVOR
public sealed class ScreenDataSource:BitmapDataSource {
  • PixelTypeAttribute - Define the type of pixel data that a Source is capable of acquiring (for example, black and white, gray, RGB, etc.)
[PixelType(TwPixelType.RGB,DefaultValue = TwPixelType.RGB)] //ICAP_PIXELTYPE
public sealed class ScreenDataSource:BitmapDataSource {
  • PlanarChunkyAttribute - Define color data formats are available
[PlanarChunky(TwPC.Chunky,DefaultValue = TwPC.Chunky)] //ICAP_PLANARCHUNKY
public sealed class ScreenDataSource:BitmapDataSource {
  • ThresholdAttribute - Specifies the dividing line between black and white. This is the value the Source will use to threshold, if needed, when ICAPPIXELTYPE = TWPTBW
[Threshold(128f)] //ICAP_THRESHOLD
public sealed class ScreenDataSource:BitmapDataSource {

Instead of using the above attributes you can override DataSource.OnCapabilityValueNeeded method.

protected override void OnCapabilityValueNeeded(CapabilityEventArgs e) {
    // ...
    for(var _cap = e.Capability.CapabilityInfo.Capability; this._Handlers.ContainsKey(_cap);) {
        this._Handlers[_cap](e.Capability);
        break;
    }

    // CAP_DEVICEONLINE 
    switch(e.Capability.CapabilityInfo.Capability) {
        case TwCap.DeviceOnline:
            e.Capability.Value=this._Screen!=null;
            break;
    }
    // ...
}

Last edited Jul 31, 2016 at 1:17 PM by SARAFF, version 4