Ejemplo n.º 1
0
        public StreamDeckJpgHardwareBase(GridKeyPositionCollection keyPositions)
        {
            jpgEncoder         = ImageCodecInfo.GetImageDecoders().Where(d => d.FormatID == ImageFormat.Jpeg.Guid).First();
            jpgParams          = new EncoderParameters(1);
            jpgParams.Param[0] = new EncoderParameter(Encoder.Quality, 100L);

            Keys    = keyPositions;
            imgSize = keyPositions.KeyWidth;
        }
        public void SimpleLayoutProducesExcpectedResults()
        {
            //creates a key layout with 2x2 = 4 keys, each 10x10px with 5px in between
            var keys = new GridKeyPositionCollection(2, 2, 20, 30, 5, 10);

            keys.Count.Should().Be(4);
            keys.Area.Left.Should().Be(0);
            keys.Area.Top.Should().Be(0);
            keys.Area.Width.Should().Be(45, $"because 2 keys each 20px wide and a gap of 5px");
            keys.Area.Height.Should().Be(70, $"because 2 keys each 30px high and a gap of 10px");
        }
 static StreamDeckXlHardwareInfo()
 {
     keyPositions = new GridKeyPositionCollection(8, 4, imgSize, 25);
 }
Ejemplo n.º 4
0
 static StreamDeckRev2HardwareInfo()
 {
     keyPositions = new GridKeyPositionCollection(5, 3, imgSize, 25);
 }
Ejemplo n.º 5
0
 static StreamDeckHardwareInfo()
 {
     //3x2 keys with 72x72px icons and 25px in between
     keyPositions = new GridKeyPositionCollection(5, 3, ImgWidth, 25);
 }
 static StreamDeckMiniHardwareInfo()
 {
     //3x2 keys with 80x80px icons and 25px in between
     keyPositions = new GridKeyPositionCollection(3, 2, imgWidth, 25);
 }