Пример #1
0
        public override void WriteTo(FlashWriter output)
        {
            int maxBits = 0;

            long[] paddedValues = FlashTools.GetMaxPaddedBitsNeeded(
                out maxBits, X, TwipsWidth, Y, TwipsHeight);

            output.WriteBits(5, maxBits);
            for (int i = 0; i < paddedValues.Length; i++)
            {
                output.WriteBits(maxBits, paddedValues[i]);
            }
        }
Пример #2
0
        public int GetByteSize()
        {
            int maxBits = 0;

            long[] paddedValues = FlashTools.GetMaxPaddedBitsNeeded(
                out maxBits, X, TwipsWidth, Y, TwipsHeight);

            int maxBytes = (maxBits / 8);

            maxBytes += (maxBits % 8) * 8;

            return(((maxBits / 8) * paddedValues.Length) + 1);
        }