Пример #1
0
        private void LoadPixels()
        {
            if (mCharBuf == null)
            {
                throw new EhllapiExcp("LoadPixels failed. PresentationSpace buffer is empty.");
            }

            mPixels = new LinkedList <PresentationSpacePixel>();
            DisplayLocation loc = new DisplayLocation(1, 1);

            // loop for every character in the character buffer.
            for (int ix = 0; ix < mCharBuf.Length; ix = ix + mPixelSx)
            {
                // create a pixel from the char and color byte buffers.
                PresentationSpacePixel pixel = null;
                if (mPixelSx == 2)
                {
                    pixel =
                        new PresentationSpacePixel(
                            mCharBuf[ix],
                            new CharAttrByte(mCharBuf[ix + 1]),
                            new ColorAttrByte(mColorBuf[ix + 1]));
                }
                else
                {
                    pixel = new PresentationSpacePixel(mCharBuf[ix]);
                }

                pixel.DisplayLocation = loc;
                mPixels.AddLast(pixel);

                // advance to the next display location in the presentation space.
                loc = Dim.IncDisplayLocation(loc);
            }
        }