/// <summary> /// Parse TS_COMPRESSED_BITMAP_HEADER_EX /// </summary> /// <param name="data">data to be parsed</param> /// <param name="currentIndex">current parser index</param> /// <returns></returns> private TS_COMPRESSED_BITMAP_HEADER_EX ParseExBitmapdataHeader( byte[] data, ref int currentIndex) { TS_COMPRESSED_BITMAP_HEADER_EX exTsCompressedBitmapHeader = new TS_COMPRESSED_BITMAP_HEADER_EX(); exTsCompressedBitmapHeader.highUniqueId = ParseUInt32(data, ref currentIndex, false); exTsCompressedBitmapHeader.lowUniqueId = ParseUInt32(data, ref currentIndex, false); exTsCompressedBitmapHeader.tmMilliseconds = ParseUInt64(data, ref currentIndex, false); exTsCompressedBitmapHeader.tmSeconds = ParseUInt64(data, ref currentIndex, false); return exTsCompressedBitmapHeader; }
private TS_COMPRESSED_BITMAP_HEADER_EX Create_TS_COMPRESSED_BITMAP_HEADER_EX() { Random rnd = new Random(DateTime.Now.Millisecond); TS_COMPRESSED_BITMAP_HEADER_EX tsCompressedBitmapHeaderEx = new TS_COMPRESSED_BITMAP_HEADER_EX(); tsCompressedBitmapHeaderEx.highUniqueId = (uint)rnd.Next(); tsCompressedBitmapHeaderEx.lowUniqueId = (uint)rnd.Next(); ulong creatTime = (ulong)DateTime.UtcNow.ToUniversalTime().Subtract(new DateTime(1970,1,1,0,0,0, DateTimeKind.Utc)).TotalMilliseconds; tsCompressedBitmapHeaderEx.tmMilliseconds = creatTime % 1000; tsCompressedBitmapHeaderEx.tmSeconds = creatTime / 1000; return tsCompressedBitmapHeaderEx; }