Beispiel #1
0
        private static void SplitRecObject(byte[] curArr)
        {
            int num  = 12;
            int num1 = 4;

            if (curArr[9] != 64)
            {
                num1 = 8;
            }
            int       num2       = num + (int)MetaForm.Format_Size2(curArr[4], curArr[5]) * num1;
            int       length     = (int)curArr.Length;
            ArrayList arrayLists = new ArrayList();
            int       num3       = -1;

            while (num2 < length)
            {
                if (curArr[num2] == 0)
                {
                    if (num2 + 1 >= length || curArr[num2 + 1] == 0)
                    {
                        break;
                    }
                    arrayLists.Add(new MetaForm.ObjectEnt());
                    num3++;
                    if (curArr[num2 + 1] == 1)
                    {
                        (arrayLists[num3] as MetaForm.ObjectEnt).type = MetaForm.ObjTypeRecord.objLine;
                    }
                    if (curArr[num2 + 1] == 3)
                    {
                        (arrayLists[num3] as MetaForm.ObjectEnt).type = MetaForm.ObjTypeRecord.objBezier;
                    }
                }
                if ((arrayLists[num3] as MetaForm.ObjectEnt).type == MetaForm.ObjTypeRecord.objBezier &&
                    curArr[num2] == 1 ||
                    (arrayLists[num3] as MetaForm.ObjectEnt).type == MetaForm.ObjTypeRecord.objLine && curArr[num2] == 3)
                {
                    arrayLists.Add(new MetaForm.ObjectEnt());
                    num3++;
                    if (curArr[num2] == 1)
                    {
                        (arrayLists[num3] as MetaForm.ObjectEnt).type = MetaForm.ObjTypeRecord.objLine;
                    }
                    if (curArr[num2] == 3)
                    {
                        (arrayLists[num3] as MetaForm.ObjectEnt).type = MetaForm.ObjTypeRecord.objBezier;
                    }
                    int count = (arrayLists[num3 - 1] as MetaForm.ObjectEnt).points.Count - 1;
                    (arrayLists[num3] as MetaForm.ObjectEnt).points.Add(
                        (arrayLists[num3 - 1] as MetaForm.ObjectEnt).points[count]);
                    (arrayLists[num3] as MetaForm.ObjectEnt).compobj = num3 - 1;
                }
                if (num1 != 4)
                {
                    (arrayLists[num3] as MetaForm.ObjectEnt).points.Add(
                        new PointF(MetaForm.FormatSize((int)curArr[num + 2], (int)curArr[num + 3]),
                                   MetaForm.FormatSize((int)curArr[num + 6], (int)curArr[num + 7])));
                }
                else
                {
                    (arrayLists[num3] as MetaForm.ObjectEnt).points.Add(
                        new PointF(MetaForm.Format_Size2(curArr[num], curArr[num + 1]),
                                   MetaForm.Format_Size2(curArr[num + 2], curArr[num + 3])));
                }
                if (curArr[num2] == 129 || curArr[num2] == 161)
                {
                    (arrayLists[num3] as MetaForm.ObjectEnt).type = MetaForm.ObjTypeRecord.objCloseLine;
                }
                if (curArr[num2] == 131 || curArr[num2] == 163)
                {
                    (arrayLists[num3] as MetaForm.ObjectEnt).type = MetaForm.ObjTypeRecord.objCloseBezier;
                }
                num = num + num1;
                num2++;
            }
            MetaForm.AddObjectsPath(arrayLists);
        }