Пример #1
0
 internal void ProcessRecord(int flags, EmfPlusRecordType recordType, byte[] RecordData)
 {
     switch (recordType)
     {
         case EmfPlusRecordType.Header:
             break;
         case EmfPlusRecordType.SetPageTransform:
             EMFSetPageTransform P = EMFSetPageTransform.getTransform(flags, RecordData);
             break;
         case EmfPlusRecordType.Object:
             EMFRecordObject O = EMFRecordObject.getObject(flags, RecordData);
             if (O != null)
             {
                 if (ObjectTable.Contains(O.ObjectID))
                 {
                     ObjectTable[O.ObjectID] = O;
                 }
                 else
                 {
                     ObjectTable.Add(O.ObjectID, O);
                 }
             }
             break;
         case EmfPlusRecordType.DrawLines:
             //After each instruction we must do something, as the object table is constantly being changed...
             //and we need to use what is currently in the table!
             DrawLines DL = new DrawLines(X, Y, Width, Height, ObjectTable);
             PageItems.AddRange(DL.Process(flags, RecordData));
             break;
         case EmfPlusRecordType.DrawString:
             DrawString DS = new DrawString(X, Y, Width, Height, ObjectTable);
             PageItems.AddRange(DS.Process(flags, RecordData));
             break;
         case EmfPlusRecordType.FillRects:
             FillRects FR = new FillRects(X, Y, Width, Height, ObjectTable);
             PageItems.AddRange(FR.Process(flags, RecordData));
             break;
         case EmfPlusRecordType.DrawRects:
             DrawRects DR = new DrawRects(X, Y, Width, Height, ObjectTable);
             PageItems.AddRange(DR.Process(flags, RecordData));
             break;
         case EmfPlusRecordType.FillPolygon:
             FillPolygon FPo = new FillPolygon(X, Y, Width, Height, ObjectTable);
             PageItems.AddRange(FPo.Process(flags, RecordData));
             break;
         case EmfPlusRecordType.DrawEllipse:
             DrawEllipse DE = new DrawEllipse(X, Y, Width, Height, ObjectTable);
             PageItems.AddRange(DE.Process(flags, RecordData));
             break;
         case EmfPlusRecordType.FillEllipse:
             FillEllipse FE = new FillEllipse(X, Y, Width, Height, ObjectTable);
             PageItems.AddRange(FE.Process(flags, RecordData));
             break;
         case EmfPlusRecordType.FillPie:
             FillPie FP = new FillPie(X, Y, Width, Height, ObjectTable);
             PageItems.AddRange(FP.Process(flags, RecordData));
             break;
         case EmfPlusRecordType.DrawPie:
             DrawPie DP = new DrawPie(X, Y, Width, Height, ObjectTable);
             PageItems.AddRange(DP.Process(flags, RecordData));
             break;
         case EmfPlusRecordType.DrawCurve:
             DrawCurve DC = new DrawCurve(X, Y, Width, Height, ObjectTable);
             PageItems.AddRange(DC.Process(flags, RecordData));
             break;
         case EmfPlusRecordType.Comment:
             Comment CM = new Comment(X, Y, Width, Height, ObjectTable);
             PageItems.AddRange(CM.Process(flags, RecordData));
             break;
         default:
             break;
     }
 }