Пример #1
0
        protected override void DrawBitmap()
        {
            if (_bitmap == null || RefreshBitmap)
            {
                _bitmap       = StreamDeckPanel.Validate(_imageFile);
                RefreshBitmap = false;
            }

            if (_keyBitmap == null)
            {
                _keyBitmap = KeyBitmap.Create.FromBitmap(_bitmap);
            }
        }
        protected override void DrawBitmap()
        {
            if (_backgroundBitmap == null || _loadBackground)
            {
                _backgroundBitmap = StreamDeckPanel.Validate(_backgroundBitmapPath);
                RefreshBitmap     = true;
            }

            if (_bitmap == null || RefreshBitmap)
            {
                _bitmap       = BitMapCreator.CreateStreamDeckBitmap(ButtonFinalText, TextFont, FontColor, OffsetX, OffsetY, _backgroundBitmap);
                RefreshBitmap = false;
            }
        }
Пример #3
0
        protected override void DrawBitmap()
        {
            if (_bitmap == null || RefreshBitmap)
            {
                _bitmap = StreamDeckPanel.Validate(_imageFile);

                if (BitMapCreator.IsSmallerThanStreamdeckDefault(_bitmap))
                {
                    _bitmap = BitMapCreator.AdjustBitmap(_bitmap, 1.0f, 4.0f, 1.0f);
                    _bitmap = BitMapCreator.EnlargeBitmapCanvas(_bitmap);
                }
                RefreshBitmap = false;
            }

            if (_keyBitmap == null)
            {
                _keyBitmap = KeyBitmap.Create.FromBitmap(_bitmap);
            }
        }
        protected override void DrawBitmap()
        {
            if (_backgroundBitmap == null || _loadBackground)
            {
                _backgroundBitmap = StreamDeckPanel.Validate(_backgroundBitmapPath);
                RefreshBitmap     = true;
            }

            if (_bitmap == null || RefreshBitmap)
            {
                if (string.IsNullOrEmpty(_backgroundBitmapPath)) //User maybe only wants text displayed.
                {
                    _bitmap = BitMapCreator.CreateStreamDeckBitmap(ButtonFinalText, TextFont, FontColor, Color.LightGray, OffsetX, OffsetY);
                }
                else
                {
                    _bitmap = BitMapCreator.CreateStreamDeckBitmap(ButtonFinalText, TextFont, FontColor, OffsetX, OffsetY, _backgroundBitmap);
                }
                RefreshBitmap = true;
            }
        }