Пример #1
0
        public void resExport_Map(String subFolderName,  String strFormat, SmallDialog_ExportConfig dialogRes)
        {
            mapImgsManagerForExport = mapImagesManager.Clone();
            mapsManagerForExport = mapsManager.cloneForExport(mapImgsManagerForExport);
            mapsManagerForExport.tileGfxManager.clearSpilth(false);
            //新生成的图片组
            MImgsManager mImgsManagerGenerated = new MImgsManager();
            //获取链接分组列表
            List<List<MImgElement>> allGroups = mapImgsManagerForExport.getAllUsedGroups();
            //处理优化分组
            for (int i = 0; i < allGroups.Count - 1; i++)
            {
                List<MImgElement> group = allGroups[i];
                Size needSize;
                int usedSpace;
                Image imgExort;
                MImgElement imgElement = MImgsManager.optimizeClips(group, out needSize, out usedSpace, out imgExort, true);
                mImgsManagerGenerated.Add(imgElement);
                SaveGenImage(strFormat, subFolderName, imgElement);
            }
            //处理禁止优化分组
            List<MImgElement> groupForbidOpt = allGroups[allGroups.Count - 1];
            foreach (MImgElement imgElement in groupForbidOpt)
            {
                mImgsManagerGenerated.Add(imgElement);
                imgElement.image = GraphicsUtil.getMatchImage((Bitmap)imgElement.image);
                SaveGenImage(strFormat, subFolderName, imgElement);
            }
            //变更图片管理器
            mapImgsManagerForExport = mImgsManagerGenerated;
            mapsManagerForExport.tileGfxManager.imagesManager = mapImgsManagerForExport;

            dialogRes.setStep(1, 1);
        }
Пример #2
0
 private void 导出数据ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     //if (Lisence.currentLiscence == Lisence.CDKey_Try )
     //{
     //    return;
     //}
     //if (Lisence.currentLiscence != Lisence.CDKey_Develop)
     //{
     //    Lisence.checkNetworkTime();
     //    if (Lisence.userOverDay > 0)
     //    {
     //        Console.WriteLine("Consts.userNbDay:" + Lisence.userOverDay);
     //        return;
     //    }
     //}
     //显示导出窗口
     SmallDialog_ExportConfig exportDialog = new SmallDialog_ExportConfig(this);
     exportDialog.initDialog();
     exportDialog.ShowDialog();
 }
Пример #3
0
 public void resExport_Animation(String subFolderName, String strFormat, SmallDialog_ExportConfig dialogRes)
 {
     //克隆会改变的文档数据
     animClipsManagerForExport = form_MAnimation.form_MImgsList.MClipsManager.CloneForExport();
     animImgsManagerForExport = form_MAnimation.form_MImgsList.mImgsManager.Clone();
     animActorsManagerExport = form_MAnimation.form_MActorList.actorsManager.Clone();
     //关联引用(动画->切块)
     MActorsManager MAM = animActorsManagerExport;     
     for (int i1 = 0; i1 < MAM.Count(); i1++)
     {
         for (int i2 = 0; i2 < MAM[i1].Count(); i2++)
         {
             for (int i3 = 0; i3 < MAM[i1][i2].Count(); i3++)
             {
                 for (int i4 = 0; i4 < MAM[i1][i2][i3].Count(); i4++)
                 {
                     for (int i5 = 0; i5 < MAM[i1][i2][i3][i4].Count(); i5++)
                     {
                         for (int i6 = 0; i6 < MAM[i1][i2][i3][i4][i5].Count(); i6++)
                         {
                             MFrameUnit unit = MAM[i1][i2][i3][i4][i5][i6];
                             if (unit is MFrameUnit_Bitmap)
                             {
                                 MFrameUnit_Bitmap unitBitmap = (MFrameUnit_Bitmap)unit;
                                 unitBitmap.clipElement = animClipsManagerForExport[unitBitmap.clipElement.GetID()];
                             }
                         }
                     }
                 }
             }
         }
     }
     //关联引用(切块->图片)
     for (int i=0;i<animClipsManagerForExport.Count();i++)
     {
         MClipElement clip = animClipsManagerForExport[i];
         clip.imageElement = animImgsManagerForExport[clip.imageElement.GetID()];
     }
     //清除冗余
     animClipsManagerForExport.ClearSpilth(false);
     //新生成的图片组
     MImgsManager mImgsManagerGenerated = new MImgsManager();
     //获取链接分组列表
     List<List<MImgElement>> allGroups = animImgsManagerForExport.getAllUsedGroups();
     //处理优化分组
     for (int i = 0; i < allGroups.Count - 1; i++)
     {
         List<MImgElement> group = allGroups[i];
         Size needSize;
         int usedSpace;
         Image imgExort;
         MImgElement imgElement = MImgsManager.optimizeClips(group, out needSize, out usedSpace, out imgExort, true);
         mImgsManagerGenerated.Add(imgElement);
         SaveGenImage(strFormat, subFolderName, imgElement);
     }
     //处理禁止优化分组
     List<MImgElement> groupForbidOpt = allGroups[allGroups.Count-1];
     foreach (MImgElement imgElement in groupForbidOpt)
     {
         mImgsManagerGenerated.Add(imgElement);
         imgElement.image = GraphicsUtil.getMatchImage((Bitmap)imgElement.image);
         SaveGenImage(strFormat, subFolderName, imgElement);
     }
     //变更图片管理器
     animImgsManagerForExport = mImgsManagerGenerated;
     dialogRes.setStep(1, 1);
 }