Пример #1
0
        internal static TEscherBSERecord Convert(byte[] Data, TXlsImgType DataType,
                                                 TEscherDwgGroupCache DwgGroupCache, TEscherDwgCache DwgCache)
        {
            byte[] BSEHeader = TCompactFramework.GetBSEHeader(Data, (int)TBSEHeader.length, (int)TBSEHeader.rgbUid);

            using (MemoryStream BlipData = new MemoryStream())
            {
                //Common header
                BlipData.Write(BSEHeader, (int)TBSEHeader.rgbUid, (int)TBSEHeader.tag - (int)TBSEHeader.rgbUid);

                // Specific info
                if ((DataType == TXlsImgType.Jpeg) || (DataType == TXlsImgType.Png))
                {
                    LoadDataBitmap(Data, DataType, BlipData);
                }
                else
                if (DataType == TXlsImgType.Bmp)
                {
                    LoadDataBmp(Data, DataType, BlipData);
                }
                else
                {
                    LoadDataWMF(Data, DataType, BlipData);
                }

                BSEHeader[(int)TBSEHeader.btWin32] = (byte)XlsEscherConsts.XlsImgConv(DataType);
                BSEHeader[(int)TBSEHeader.btMacOS] = (byte)msoblip.PICT;

                BitOps.SetWord(BSEHeader, (int)TBSEHeader.tag, 0xFF);
                BitOps.SetCardinal(BSEHeader, (int)TBSEHeader.size, BlipData.Length + XlsEscherConsts.SizeOfTEscherRecordHeader);
                BitOps.SetCardinal(BSEHeader, (int)TBSEHeader.cRef, 0);
                BitOps.SetCardinal(BSEHeader, (int)TBSEHeader.foDelay, 0);

                TEscherRecordHeader Eh = new TEscherRecordHeader();
                Eh.Id   = (int)Msofbt.BSE;
                Eh.Pre  = 2 + ((int)XlsEscherConsts.XlsImgConv(DataType) << 4);
                Eh.Size = BitOps.GetCardinal(BSEHeader, (int)TBSEHeader.size) + BSEHeader.Length;
                TEscherBSERecord Result = new TEscherBSERecord(Eh, DwgGroupCache, DwgCache, DwgGroupCache.BStore);

                TEscherRecordHeader BlipHeader = new TEscherRecordHeader();
                BlipHeader.Id   = (int)XlsEscherConsts.XlsBlipHeaderConv(DataType);
                BlipHeader.Pre  = (int)XlsEscherConsts.XlsBlipSignConv(DataType) << 4;
                BlipHeader.Size = BlipData.Length;

                BlipData.Position = 0;
                Result.CopyFromData(BSEHeader, BlipHeader, BlipData);

                return(Result);
            }
        }
Пример #2
0
 internal TEscherConnectorRuleRecord(TEscherRecordHeader aEscherHeader, TEscherDwgGroupCache aDwgGroupCache, TEscherDwgCache aDwgCache, TEscherContainerRecord aParent)
     : base(aEscherHeader, aDwgGroupCache, aDwgCache, aParent)
 {
     Init();
 }
Пример #3
0
 internal TEscherClientTextBoxRecord(TEscherRecordHeader aEscherHeader, TEscherDwgGroupCache aDwgGroupCache, TEscherDwgCache aDwgCache, TEscherContainerRecord aParent)
     : base(aEscherHeader, aDwgGroupCache, aDwgCache, aParent)
 {
 }
Пример #4
0
 public TEscherCallOutRuleRecord(TEscherRecordHeader aEscherHeader, TEscherDwgGroupCache aDwgGroupCache, TEscherDwgCache aDwgCache, TEscherContainerRecord aParent)
     : base(aEscherHeader, aDwgGroupCache, aDwgCache, aParent)
 {
 }
Пример #5
0
 protected TRuleRecord(TEscherRecordHeader aEscherHeader, TEscherDwgGroupCache aDwgGroupCache, TEscherDwgCache aDwgCache, TEscherContainerRecord aParent)
     : base(aEscherHeader, aDwgGroupCache, aDwgCache, aParent)
 {
 }