Exemplo n.º 1
0
        public void DisplayString(string str)
        {
            displayStr = str;
            ClearScreen();
            int lineCount        = 0;//两个page拼成一个文字行,从上到下一共有8个page
            int currentPixeWidth = 0;

            Array.Clear(tempUpBuffer, 0, tempUpBuffer.Length);     //清空缓存
            Array.Clear(tempDownBuffer, 0, tempDownBuffer.Length); //清空缓存

            FontCharacterDescriptor[] fontDesGroup = new FontCharacterDescriptor[str.Length];

            for (int i = 0; i < str.Length; i++)
            {
                fontDesGroup[i] = DisplayFontTable.GetCharacterDescriptor(str[i]);

                if (currentPixeWidth < 110)
                {
                    Array.Copy(fontDesGroup[i].characterDataUp, 0, tempUpBuffer, currentPixeWidth, fontDesGroup[i].characterWidthPx);
                    Array.Copy(fontDesGroup[i].characterDataDown, 0, tempDownBuffer, currentPixeWidth, fontDesGroup[i].characterWidthPx);
                    currentPixeWidth += fontDesGroup[i].characterWidthPx;
                }
                else
                {
                    Array.Copy(fontDesGroup[i].characterDataUp, 0, tempUpBuffer, currentPixeWidth, fontDesGroup[i].characterWidthPx);
                    Array.Copy(fontDesGroup[i].characterDataDown, 0, tempDownBuffer, currentPixeWidth, fontDesGroup[i].characterWidthPx);
                    DisplayWriteLine(ref tempUpBuffer, lineCount, 0);
                    DisplayWriteLine(ref tempDownBuffer, lineCount, 1);

                    lineCount++;

                    if (lineCount > 3)
                    {
                        break;
                    }

                    currentPixeWidth = 0;
                }

                if (i == str.Length - 1)
                {
                    DisplayWriteLine(ref tempUpBuffer, lineCount, 0);
                    DisplayWriteLine(ref tempDownBuffer, lineCount, 1);
                }
            }
        }
Exemplo n.º 2
0
        public void DisplayString(string str)
        {
            displayStr = str;
            ClearScreen();
            int lineCount = 0;//����pageƴ��һ��������,���ϵ���һ����8��page
            int currentPixeWidth = 0;

            Array.Clear(tempUpBuffer, 0, tempUpBuffer.Length);//��ջ���
            Array.Clear(tempDownBuffer, 0, tempDownBuffer.Length);//��ջ���

            FontCharacterDescriptor[] fontDesGroup = new FontCharacterDescriptor[str.Length];

            for (int i = 0; i < str.Length; i++)
            {

                fontDesGroup[i] = DisplayFontTable.GetCharacterDescriptor(str[i]);

                if (currentPixeWidth < 110)
                {
                    Array.Copy(fontDesGroup[i].characterDataUp, 0, tempUpBuffer, currentPixeWidth, fontDesGroup[i].characterWidthPx);
                    Array.Copy(fontDesGroup[i].characterDataDown, 0, tempDownBuffer, currentPixeWidth, fontDesGroup[i].characterWidthPx);
                    currentPixeWidth += fontDesGroup[i].characterWidthPx;
                }
                else
                {
                    Array.Copy(fontDesGroup[i].characterDataUp, 0, tempUpBuffer, currentPixeWidth, fontDesGroup[i].characterWidthPx);
                    Array.Copy(fontDesGroup[i].characterDataDown, 0, tempDownBuffer, currentPixeWidth, fontDesGroup[i].characterWidthPx);
                    DisplayWriteLine(ref tempUpBuffer, lineCount, 0);
                    DisplayWriteLine(ref tempDownBuffer, lineCount, 1);

                    lineCount++;

                    if (lineCount > 3)
                    {
                        break;
                    }

                    currentPixeWidth = 0;

                }

                if (i == str.Length - 1)
                {
                    DisplayWriteLine(ref tempUpBuffer, lineCount, 0);
                    DisplayWriteLine(ref tempDownBuffer, lineCount, 1);
                }

            }
        }
Exemplo n.º 3
0
        void DisplayString(string str)
        {
            ClearScreen();
            int lineCount=0;//两个page拼成一行
            int currentPixeWidth=0;

            Array.Clear(tempUpBuffer, 0, tempUpBuffer.Length);//清空缓存
            Array.Clear(tempDownBuffer, 0, tempDownBuffer.Length);//清空缓存

            FontCharacterDescriptor[] fontDesGroup = new FontCharacterDescriptor[str.Length];


            for (int i = 0; i < str.Length; i++)
            {
                fontDesGroup[i] = DisplayFontTable.GetCharacterDescriptor(str[i]);

 //               Debug.WriteLine(fontDesGroup[i].characterDataUp[0].ToString("X"));


                if (currentPixeWidth < 110)
                {
                    Array.Copy(fontDesGroup[i].characterDataUp, 0, tempUpBuffer, currentPixeWidth, fontDesGroup[i].characterWidthPx);
                    Array.Copy(fontDesGroup[i].characterDataDown, 0, tempDownBuffer, currentPixeWidth, fontDesGroup[i].characterWidthPx);
                    currentPixeWidth += fontDesGroup[i].characterWidthPx;
                }
                else
                {
                    Array.Copy(fontDesGroup[i].characterDataUp, 0, tempUpBuffer, currentPixeWidth, fontDesGroup[i].characterWidthPx);
                    Array.Copy(fontDesGroup[i].characterDataDown, 0, tempDownBuffer, currentPixeWidth, fontDesGroup[i].characterWidthPx);

                    DisplayWriteLine(ref tempUpBuffer, lineCount, 0);
                    DisplayWriteLine(ref tempDownBuffer, lineCount, 1);

                    lineCount++;

                    if (lineCount > 3)
                    {
                        break;
                    }

                    currentPixeWidth =0;

                }

               
                if (i == str.Length-1)
                {
                    DisplayWriteLine(ref tempUpBuffer, lineCount, 0);
                    DisplayWriteLine(ref tempDownBuffer, lineCount, 1);
                }

                



            }

        }