Пример #1
0
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            // Choix de la couleur

            SCB_Color = SCB_Red;

            // rp1 : Liste des boutons

            Button btn;

            for (int d = 0; d < 6; d++)
            {
                for (int u = 0; u < 8; u++)
                {
                    btn = (Button)rp1.FindName("btn" + d + u);

                    btn.Background  = SCB_White;
                    btn.BorderBrush = SCB_Black;

                    if (d == 5 || u == 7)
                    {
                        btn.Background  = SCB_Grey;
                        btn.BorderBrush = SCB_Black;
                    }
                }
            }

            // rp2 : Liste des boutons

            btnRewind.Background  = SCB_White;
            btnRewind.BorderBrush = SCB_Black;

            btnPrevious.Background  = SCB_White;
            btnPrevious.BorderBrush = SCB_Black;

            btnPlay.Background  = SCB_White;
            btnPlay.BorderBrush = SCB_Black;

            btnNext.Background  = SCB_White;
            btnNext.BorderBrush = SCB_Black;

            btnFastForward.Background  = SCB_White;
            btnFastForward.BorderBrush = SCB_Black;

            //

            fcd = DisplayFontTable.GetFontCharacterDescriptorFromFontTableStandart(Order);

            FontCharacterDescriptorToScreen(fcd);

            //

            isPlaying = false;
        }
Пример #2
0
        private void BtnNext_Click(object sender, RoutedEventArgs e)
        {
            if (Order < (UInt16)(DisplayFontTable.GetFontTableStandartSize() - 1))
            {
                Order = (UInt16)(Order + 1);
            }
            else
            {
                Order = 0;
            }

            fcd = DisplayFontTable.GetFontCharacterDescriptorFromFontTableStandart(Order);
            FontCharacterDescriptorToScreen(fcd);
        }
Пример #3
0
        private void BtnPrevious_Click(object sender, RoutedEventArgs e)
        {
            if (Order > 0)
            {
                Order = (UInt16)(Order - 1);
            }
            else
            {
                Order = 255;
            }

            fcd = DisplayFontTable.GetFontCharacterDescriptorFromFontTableStandart(Order);
            FontCharacterDescriptorToScreen(fcd);
        }
Пример #4
0
        async private void BtnPlay_Click(object sender, RoutedEventArgs e)
        {
            isPlaying = !isPlaying;

            if (isPlaying)
            {
                btnPlay.Content = "\xE769";

                while (Order < (UInt16)(DisplayFontTable.GetFontTableStandartSize() - 1) && isPlaying)
                {
                    Order = (UInt16)(Order + 1);

                    fcd = DisplayFontTable.GetFontCharacterDescriptorFromFontTableStandart(Order);
                    FontCharacterDescriptorToScreen(fcd);

                    await Task.Delay(500);
                }
            }
            else
            {
                btnPlay.Content = "\xE768";
            }
        }
Пример #5
0
        public void MakeChar(UInt16 x, UInt16 y, char c, UInt16 textsize, int color)
        {
            UInt16 wCharOriginal = 6;
            UInt16 hCharOriginal = 8;

            UInt16 wCharSized = (UInt16)(wCharOriginal * textsize);
            UInt16 hCharSized = (UInt16)(hCharOriginal * textsize);

            // bounds checks
            if ((x >= LCD_W) || (y >= LCD_H) || ((x + wCharSized - 1) < 0) || ((y + hCharSized - 1) < 0))
            {
                return;
            }

            byte[] car = DisplayFontTable.GetFontCharacterDescriptorFromFontTableStandart(c).Data;

            String c0 = car[0].ToString("X");
            String c1 = car[1].ToString("X");
            String c2 = car[2].ToString("X");
            String c3 = car[3].ToString("X");
            String c4 = car[4].ToString("X");

            if (c0.Length < 2)
            {
                c0 = "0" + c0;
            }
            if (c1.Length < 2)
            {
                c1 = "0" + c1;
            }
            if (c2.Length < 2)
            {
                c2 = "0" + c2;
            }
            if (c3.Length < 2)
            {
                c3 = "0" + c3;
            }
            if (c4.Length < 2)
            {
                c4 = "0" + c4;
            }

            String c01 = c0.Substring(0, 1);
            String c00 = c0.Substring(1, 1);

            String c11 = c1.Substring(0, 1);
            String c10 = c1.Substring(1, 1);

            String c21 = c2.Substring(0, 1);
            String c20 = c2.Substring(1, 1);

            String c31 = c3.Substring(0, 1);
            String c30 = c3.Substring(1, 1);

            String c41 = c4.Substring(0, 1);
            String c40 = c4.Substring(1, 1);

            bool[] b01 = Util.Convert.ConvertHexToBin(c01);
            bool[] b00 = Util.Convert.ConvertHexToBin(c00);

            bool[] b11 = Util.Convert.ConvertHexToBin(c11);
            bool[] b10 = Util.Convert.ConvertHexToBin(c10);

            bool[] b21 = Util.Convert.ConvertHexToBin(c21);
            bool[] b20 = Util.Convert.ConvertHexToBin(c20);

            bool[] b31 = Util.Convert.ConvertHexToBin(c31);
            bool[] b30 = Util.Convert.ConvertHexToBin(c30);

            bool[] b41 = Util.Convert.ConvertHexToBin(c41);
            bool[] b40 = Util.Convert.ConvertHexToBin(c40);

            ushort[] _charOriginal = new ushort[wCharOriginal * hCharOriginal];

            if (b00[0])
            {
                _charOriginal[0] = (ushort)color;
            }
            else
            {
                _charOriginal[0] = RGB888ToRGB565(0, 0, 0);
            }
            if (b10[0])
            {
                _charOriginal[1] = (ushort)color;
            }
            else
            {
                _charOriginal[1] = RGB888ToRGB565(0, 0, 0);
            }
            if (b20[0])
            {
                _charOriginal[2] = (ushort)color;
            }
            else
            {
                _charOriginal[2] = RGB888ToRGB565(0, 0, 0);
            }
            if (b30[0])
            {
                _charOriginal[3] = (ushort)color;
            }
            else
            {
                _charOriginal[3] = RGB888ToRGB565(0, 0, 0);
            }
            if (b40[0])
            {
                _charOriginal[4] = (ushort)color;
            }
            else
            {
                _charOriginal[4] = RGB888ToRGB565(0, 0, 0);
            }
            _charOriginal[5] = RGB888ToRGB565(0, 0, 0);

            if (b00[1])
            {
                _charOriginal[6] = (ushort)color;
            }
            else
            {
                _charOriginal[6] = RGB888ToRGB565(0, 0, 0);
            }
            if (b10[1])
            {
                _charOriginal[7] = (ushort)color;
            }
            else
            {
                _charOriginal[7] = RGB888ToRGB565(0, 0, 0);
            }
            if (b20[1])
            {
                _charOriginal[8] = (ushort)color;
            }
            else
            {
                _charOriginal[8] = RGB888ToRGB565(0, 0, 0);
            }
            if (b30[1])
            {
                _charOriginal[9] = (ushort)color;
            }
            else
            {
                _charOriginal[9] = RGB888ToRGB565(0, 0, 0);
            }
            if (b40[1])
            {
                _charOriginal[10] = (ushort)color;
            }
            else
            {
                _charOriginal[10] = RGB888ToRGB565(0, 0, 0);
            }
            _charOriginal[11] = RGB888ToRGB565(0, 0, 0);

            if (b00[2])
            {
                _charOriginal[12] = (ushort)color;
            }
            else
            {
                _charOriginal[12] = RGB888ToRGB565(0, 0, 0);
            }
            if (b10[2])
            {
                _charOriginal[13] = (ushort)color;
            }
            else
            {
                _charOriginal[13] = RGB888ToRGB565(0, 0, 0);
            }
            if (b20[2])
            {
                _charOriginal[14] = (ushort)color;
            }
            else
            {
                _charOriginal[14] = RGB888ToRGB565(0, 0, 0);
            }
            if (b30[2])
            {
                _charOriginal[15] = (ushort)color;
            }
            else
            {
                _charOriginal[15] = RGB888ToRGB565(0, 0, 0);
            }
            if (b40[2])
            {
                _charOriginal[16] = (ushort)color;
            }
            else
            {
                _charOriginal[16] = RGB888ToRGB565(0, 0, 0);
            }
            _charOriginal[17] = RGB888ToRGB565(0, 0, 0);

            if (b00[3])
            {
                _charOriginal[18] = (ushort)color;
            }
            else
            {
                _charOriginal[18] = RGB888ToRGB565(0, 0, 0);
            }
            if (b10[3])
            {
                _charOriginal[19] = (ushort)color;
            }
            else
            {
                _charOriginal[19] = RGB888ToRGB565(0, 0, 0);
            }
            if (b20[3])
            {
                _charOriginal[20] = (ushort)color;
            }
            else
            {
                _charOriginal[20] = RGB888ToRGB565(0, 0, 0);
            }
            if (b30[3])
            {
                _charOriginal[21] = (ushort)color;
            }
            else
            {
                _charOriginal[21] = RGB888ToRGB565(0, 0, 0);
            }
            if (b40[3])
            {
                _charOriginal[22] = (ushort)color;
            }
            else
            {
                _charOriginal[22] = RGB888ToRGB565(0, 0, 0);
            }
            _charOriginal[23] = RGB888ToRGB565(0, 0, 0);

            if (b01[0])
            {
                _charOriginal[24] = (ushort)color;
            }
            else
            {
                _charOriginal[24] = RGB888ToRGB565(0, 0, 0);
            }
            if (b11[0])
            {
                _charOriginal[25] = (ushort)color;
            }
            else
            {
                _charOriginal[25] = RGB888ToRGB565(0, 0, 0);
            }
            if (b21[0])
            {
                _charOriginal[26] = (ushort)color;
            }
            else
            {
                _charOriginal[26] = RGB888ToRGB565(0, 0, 0);
            }
            if (b31[0])
            {
                _charOriginal[27] = (ushort)color;
            }
            else
            {
                _charOriginal[27] = RGB888ToRGB565(0, 0, 0);
            }
            if (b41[0])
            {
                _charOriginal[28] = (ushort)color;
            }
            else
            {
                _charOriginal[28] = RGB888ToRGB565(0, 0, 0);
            }
            _charOriginal[29] = RGB888ToRGB565(0, 0, 0);

            if (b01[1])
            {
                _charOriginal[30] = (ushort)color;
            }
            else
            {
                _charOriginal[30] = RGB888ToRGB565(0, 0, 0);
            }
            if (b11[1])
            {
                _charOriginal[31] = (ushort)color;
            }
            else
            {
                _charOriginal[31] = RGB888ToRGB565(0, 0, 0);
            }
            if (b21[1])
            {
                _charOriginal[32] = (ushort)color;
            }
            else
            {
                _charOriginal[32] = RGB888ToRGB565(0, 0, 0);
            }
            if (b31[1])
            {
                _charOriginal[33] = (ushort)color;
            }
            else
            {
                _charOriginal[33] = RGB888ToRGB565(0, 0, 0);
            }
            if (b41[1])
            {
                _charOriginal[34] = (ushort)color;
            }
            else
            {
                _charOriginal[34] = RGB888ToRGB565(0, 0, 0);
            }
            _charOriginal[35] = RGB888ToRGB565(0, 0, 0);

            if (b01[2])
            {
                _charOriginal[36] = (ushort)color;
            }
            else
            {
                _charOriginal[36] = RGB888ToRGB565(0, 0, 0);
            }
            if (b11[2])
            {
                _charOriginal[37] = (ushort)color;
            }
            else
            {
                _charOriginal[37] = RGB888ToRGB565(0, 0, 0);
            }
            if (b21[2])
            {
                _charOriginal[38] = (ushort)color;
            }
            else
            {
                _charOriginal[38] = RGB888ToRGB565(0, 0, 0);
            }
            if (b31[2])
            {
                _charOriginal[39] = (ushort)color;
            }
            else
            {
                _charOriginal[39] = RGB888ToRGB565(0, 0, 0);
            }
            if (b41[2])
            {
                _charOriginal[40] = (ushort)color;
            }
            else
            {
                _charOriginal[40] = RGB888ToRGB565(0, 0, 0);
            }
            _charOriginal[41] = RGB888ToRGB565(0, 0, 0);

            _charOriginal[42] = RGB888ToRGB565(0, 0, 0);
            _charOriginal[43] = RGB888ToRGB565(0, 0, 0);
            _charOriginal[44] = RGB888ToRGB565(0, 0, 0);
            _charOriginal[45] = RGB888ToRGB565(0, 0, 0);
            _charOriginal[46] = RGB888ToRGB565(0, 0, 0);
            _charOriginal[47] = RGB888ToRGB565(0, 0, 0);

            ushort[] _charSized = new ushort[wCharSized * hCharSized];

            int cs = 0;

            for (int hco = 0; hco < hCharOriginal; hco++)
            {
                for (int hts = 0; hts < textsize; hts++)
                {
                    for (int wco = 0; wco < wCharOriginal; wco++)
                    {
                        for (int wts = 0; wts < textsize; wts++)
                        {
                            _charSized[cs] = _charOriginal[hco * wCharOriginal + wco];

                            cs++;
                        }
                    }
                }
            }

            DrawPicture08(_charSized, wCharSized, hCharSized, x, y);
        }
Пример #6
0
 private void BtnFastForward_Click(object sender, RoutedEventArgs e)
 {
     Order = (UInt16)(DisplayFontTable.GetFontTableStandartSize() - 1);
     fcd   = DisplayFontTable.GetFontCharacterDescriptorFromFontTableStandart(Order);
     FontCharacterDescriptorToScreen(fcd);
 }
Пример #7
0
 private void BtnRewind_Click(object sender, RoutedEventArgs e)
 {
     Order = 0;
     fcd   = DisplayFontTable.GetFontCharacterDescriptorFromFontTableStandart(Order);
     FontCharacterDescriptorToScreen(fcd);
 }