/// <summary>
        /// 遍历图层中的所有TextFrame
        /// </summary>
        /// <param name="layer"></param>
        /// <returns></returns>
        private static List<Illustrator.TextFrame> GetLayerInText(Illustrator.Layer layer)
        {
            List<Illustrator.TextFrame> listText = new List<Illustrator.TextFrame>();
            foreach (Illustrator.TextFrame text in layer.TextFrames)
            {
                listText.Add(text);
            }
            foreach (Illustrator.GroupItem group1 in layer.GroupItems)
            {
                List<Illustrator.TextFrame> listText1 = GetGroupInText(group1);
                listText.AddRange(listText1);
            }
            return listText;
        }


/// <summary>
        /// 遍历组中的TextFrame
        /// </summary>
        /// <param name="group"></param>
        /// <returns></returns>
        private static List<Illustrator.TextFrame> GetGroupInText(Illustrator.GroupItem group)
        {
            List<Illustrator.TextFrame> listText = new List<Illustrator.TextFrame>();
            foreach (Illustrator.TextFrame text in group.TextFrames)
            {
                listText.Add(text);
            }
            foreach (Illustrator.GroupItem group1 in group.GroupItems)
            {
                List<Illustrator.TextFrame> listText1 = GetGroupInText(group1);
                listText.AddRange(listText1);
            }
            return listText;
        }


/// <summary>
        /// 遍历组中的GroupItem
        /// </summary>
        /// <param name="group"></param>
        /// <returns></returns>
        private static List<Illustrator.GroupItem> GetGroupInGroupItem(Illustrator.GroupItem group)
        {
            List<Illustrator.GroupItem> listGroup = new List<Illustrator.GroupItem>();
            foreach (Illustrator.GroupItem groupsub in group.GroupItems)
            {
                listGroup.Add(groupsub);
            }
            foreach (Illustrator.GroupItem groupsub in group.GroupItems)
            {
                List<Illustrator.GroupItem> groupsub1 = GetGroupInGroupItem(groupsub);
                listGroup.AddRange(groupsub1);
            }
            return listGroup;
        }

点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论

微信小程序

微信扫一扫体验

立即
投稿

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部