Exemple #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);
            }
        }
Exemple #2
0
        protected override TEscherRecord DoCopyTo(int RowOfs, int ColOfs, TEscherDwgCache NewDwgCache, TEscherDwgGroupCache NewDwgGroupCache, TSheetInfo SheetInfo)
        {
            TEscherCallOutRuleRecord R = (TEscherCallOutRuleRecord)base.DoCopyTo(RowOfs, ColOfs, NewDwgCache, NewDwgGroupCache, SheetInfo);

            if (Shape != null)
            {
                R.Shape = (TEscherSpRecord)Shape.CopiedTo(SheetInfo.CopiedGen);
                if (R.Shape != null)
                {
                    R.SpId = R.Shape.ShapeId;
                }
                else
                {
                    R.SpId = 0;
                }
            }
            R.RuleId = DwgCache.Solver.IncMaxRuleId();
            return(R);
        }
Exemple #3
0
        protected override TEscherRecord DoCopyTo(int RowOfs, int ColOfs, TEscherDwgCache NewDwgCache, TEscherDwgGroupCache NewDwgGroupCache, TSheetInfo SheetInfo)
        {
            TEscherConnectorRuleRecord Result = (TEscherConnectorRuleRecord)base.DoCopyTo(RowOfs, ColOfs, NewDwgCache, NewDwgGroupCache, SheetInfo);

            Result.Init();
            for (int c = 0; c < 3; c++)
            {
                if (Shapes[c] != null)
                {
                    Result.Shapes[c] = (TEscherSpRecord)Shapes[c].CopiedTo(SheetInfo.CopiedGen);
                    if (Result.Shapes[c] != null)
                    {
                        Result.SetSpIds(c, Result.Shapes[c].ShapeId);
                    }
                    else
                    {
                        Result.SetSpIds(c, 0);
                    }
                }
            }
            Result.RuleId = DwgCache.Solver.IncMaxRuleId();
            return(Result);
        }
Exemple #4
0
 internal TEscherConnectorRuleRecord(TEscherRecordHeader aEscherHeader, TEscherDwgGroupCache aDwgGroupCache, TEscherDwgCache aDwgCache, TEscherContainerRecord aParent)
     : base(aEscherHeader, aDwgGroupCache, aDwgCache, aParent)
 {
     Init();
 }
Exemple #5
0
 /// <summary>
 /// Create from data.
 /// </summary>
 /// <param name="aDwgGroupCache"></param>
 /// <param name="aDwgCache"></param>
 /// <param name="aParent"></param>
 internal TEscherClientTextBoxRecord(TEscherDwgGroupCache aDwgGroupCache, TEscherDwgCache aDwgCache, TEscherContainerRecord aParent)
     : base(new TEscherRecordHeader(0, (int)Msofbt.ClientTextbox, 0), aDwgGroupCache, aDwgCache, aParent)
 {
     LoadedDataSize = 0;
 }
Exemple #6
0
 internal TEscherClientTextBoxRecord(TEscherRecordHeader aEscherHeader, TEscherDwgGroupCache aDwgGroupCache, TEscherDwgCache aDwgCache, TEscherContainerRecord aParent)
     : base(aEscherHeader, aDwgGroupCache, aDwgCache, aParent)
 {
 }
Exemple #7
0
 public TEscherCallOutRuleRecord(TEscherRecordHeader aEscherHeader, TEscherDwgGroupCache aDwgGroupCache, TEscherDwgCache aDwgCache, TEscherContainerRecord aParent)
     : base(aEscherHeader, aDwgGroupCache, aDwgCache, aParent)
 {
 }
Exemple #8
0
 protected TRuleRecord(TEscherRecordHeader aEscherHeader, TEscherDwgGroupCache aDwgGroupCache, TEscherDwgCache aDwgCache, TEscherContainerRecord aParent)
     : base(aEscherHeader, aDwgGroupCache, aDwgCache, aParent)
 {
 }
Exemple #9
0
 protected override TEscherRecord DoCopyTo(int RowOfs, int ColOfs, TEscherDwgCache NewDwgCache, TEscherDwgGroupCache NewDwgGroupCache, TSheetInfo SheetInfo)
 {
     XlsMessages.ThrowException(XlsErr.ErrNotImplemented, "Align Rule");
     return(null);
 }
Exemple #10
0
 internal void CopyFrom(int RowOfs, int ColOfs, TEscherRecordList aEscherRecordList, TEscherDwgCache NewDwgCache, TEscherDwgGroupCache NewDwgGroupCache, TSheetInfo SheetInfo)
 {
     if (aEscherRecordList == null)
     {
         return;
     }
     if (aEscherRecordList.FList == FList)
     {
         XlsMessages.ThrowException(XlsErr.ErrInternal);                                   //Should be different objects
     }
     for (int i = 0; i < aEscherRecordList.Count; i++)
     {
         Add(TEscherRecord.Clone(aEscherRecordList[i], RowOfs, ColOfs, NewDwgCache, NewDwgGroupCache, SheetInfo));
     }
 }