public void make(ref PageArrayBin pageArrayBin, ref SVSerialize serialize)
        {
            UInt32 pageCount  = pageArrayBin.pageCount;
            UInt32 heartCount = pageArrayBin.pageArray[pageCount].tickNum++;

            if (pageArrayBin.pageArray[pageCount].m_tick == null)
            {
                pageArrayBin.pageArray[pageCount].m_tick = new TickBin[SVLimit.PAGE_TICKGIF_MAXNUM];
            }


            TickBin tickBin = pageArrayBin.pageArray[pageCount].m_tick[heartCount];

            tickBin.imageOffsetList = new UInt32[8];

            tickBin.id      = ID;
            tickBin.rect.sX = (UInt16)Rect.X;
            tickBin.rect.sY = (UInt16)Rect.Y;
            tickBin.rect.eX = (UInt16)(Rect.Width + tickBin.rect.sX - 1);
            tickBin.rect.eY = (UInt16)(Rect.Height + tickBin.rect.sY - 1);

            ///保存所有图片数据
            List <SVBitmap> list = _bitMapArray.imageArray();

            tickBin.count = (Byte)list.Count;

            for (int i = 0; i < list.Count; i++)
            {
                var offset = list[i];
                tickBin.imageOffsetList[i] = (UInt32)serialize.ToArray().Length;
                serialize.pack(offset.bitmap8Data(Rect.Width, Rect.Height));
            }

            pageArrayBin.pageArray[pageCount].m_tick[heartCount] = tickBin;
        }
Beispiel #2
0
        public void make(ref PageArrayBin pageArrayBin, ref SVSerialize serialize)
        {
            UInt32 pageCount = pageArrayBin.pageCount;
            UInt32 gifCount  = pageArrayBin.pageArray[pageCount].gif_num++;

            if (pageArrayBin.pageArray[pageCount].m_gif == null)
            {
                pageArrayBin.pageArray[pageCount].m_gif = new GifBin[SVLimit.PAGE_GIF_MAXNUM];
            }

            GifBin gifBin = pageArrayBin.pageArray[pageCount].m_gif[gifCount];

            gifBin.addOffset = new UInt32[8];
            gifBin.varType   = new Byte[8];

            gifBin.id      = ID;
            gifBin.rect.sX = (UInt16)Rect.X;
            gifBin.rect.sY = (UInt16)Rect.Y;
            gifBin.rect.eX = (UInt16)(Rect.Width + gifBin.rect.sX);
            gifBin.rect.eY = (UInt16)(Rect.Height + gifBin.rect.sY);

            ///图片数组地址
            gifBin.imageOffset = new UInt32[8];

            ///保存所有图片数据
            List <SVBitmap> list = _pic.imageArray();

            for (int i = 0; i < list.Count; i++)
            {
                var address = list[i];
                gifBin.imageOffset[i] = (UInt32)serialize.ToArray().Length;
                serialize.pack(address.bitmap8Data(Rect.Width, Rect.Height));
            }

            ///写入当前错误图片数据
            var errorAddress = PicError.bitmap8Data(Rect.Width, Rect.Height);

            if (errorAddress != null)
            {
                gifBin.iamgeOffsetErr = (UInt32)serialize.ToArray().Length;
                serialize.pack(errorAddress);
            }

            ///根据名称来获取地址
            var varInstance = SVVaribleType.instance();

            for (int i = 0; i < _var.Count; i++)
            {
                gifBin.addOffset[i] = varInstance.strToAddress(_var[i], _varType[i]);
                gifBin.varType[i]   = (Byte)varInstance.strToType(_var[i], _varType[i]);
            }

            ///变量个数
            gifBin.type = Convert.ToByte(_var.Count);

            pageArrayBin.pageArray[pageCount].m_gif[gifCount] = gifBin;
        }