Beispiel #1
0
        ARGBImageData ToImage()
        {
            var w            = BufferWidth - 12;
            var h            = BufferHeight - 24;
            var data         = new ARGBImageData(w, h);
            var targetOffset = 0;
            var sourceOffset = (BufferWidth * (12 + offsetVertical)) + offsetHorizontal + 6;

            for (var y = 0; y < h; y++)
            {
                for (var x = 0; x < w; x++)
                {
                    var  colorIndex = buffer[sourceOffset + x];
                    ARGB color;
                    if (TransparentColorOverride && ((colorIndex == transparentColor) || (colorIndex == clearColor)))
                    {
                        color = TransparentColorValue;
                    }
                    else
                    {
                        color       = palette[colorIndex];
                        color.Alpha = GlobalAlpha;
                    }
                    data[targetOffset++] = color;
                    sourceOffset        += BufferWidth;
                }
            }
            return(data);
        }
        ARGBImageData ToImage()
        {
            int w            = BufferWidth - 12;
            int h            = BufferHeight - 24;
            var data         = new ARGBImageData(w, h);
            int targetOffset = 0;
            int sourceOffset = (BufferWidth * (12 + m_OffsetVertical)) + m_OffsetHorizontal + 6;

            for (int y = 0; y < h; y++)
            {
                for (int x = 0; x < w; x++)
                {
                    byte colorIndex = m_Buffer[sourceOffset + x];
                    ARGB color;
                    if (TransparentColorOverride && ((colorIndex == m_TransparentColor) || (colorIndex == m_ClearColor)))
                    {
                        color = TransparentColorValue;
                    }
                    else
                    {
                        color       = m_Palette[colorIndex];
                        color.Alpha = GlobalAlpha;
                    }
                    data[targetOffset++] = color;
                    sourceOffset        += BufferWidth;
                }
            }
            return(data);
        }