예제 #1
0
        public static UnsafeBitmap PackBitmaps(Vex.VexObject vo, Dictionary <uint, Rectangle> outputBitmaps)
        {
            Gdi.GdiRenderer           renderer      = new Gdi.GdiRenderer();
            Dictionary <uint, Bitmap> sourceBitmaps = renderer.GenerateMappedBitmaps(vo, true);

            if (sourceBitmaps.Count == 0)
            {
                throw new Exception("There are no symbols to arrange");
            }

            List <ArrangedBitmap> bitmaps = new List <ArrangedBitmap>();

            foreach (uint key in sourceBitmaps.Keys)
            {
                Vex.IDefinition def    = vo.Definitions[key];
                Bitmap          sbmp   = sourceBitmaps[key];
                ArrangedBitmap  bitmap = new ArrangedBitmap();
                bitmap.Width  = sbmp.Width + 2;
                bitmap.Height = sbmp.Height + 2;
                bitmap.Id     = def.Id;
                bitmaps.Add(bitmap);
            }

            Size bmpSize = ProcessRectangles(bitmaps);

            return(CopyBitmapsToOutput(bitmaps, sourceBitmaps, outputBitmaps, bmpSize.Width, bmpSize.Height));
        }
예제 #2
0
        public static UnsafeBitmap PackBitmaps(Vex.VexObject vo, Dictionary<uint, Rectangle> outputBitmaps)
        {
            Gdi.GdiRenderer renderer = new Gdi.GdiRenderer();
            Dictionary<uint, Bitmap> sourceBitmaps = renderer.GenerateMappedBitmaps(vo, true);

            if (sourceBitmaps.Count == 0)
            {
                throw new Exception("There are no symbols to arrange");
            }

            List<ArrangedBitmap> bitmaps = new List<ArrangedBitmap>();
            foreach (uint key in sourceBitmaps.Keys)
            {
                Vex.IDefinition def = vo.Definitions[key];
                Bitmap sbmp = sourceBitmaps[key];
                ArrangedBitmap bitmap = new ArrangedBitmap();
                bitmap.Width = sbmp.Width + 2;
                bitmap.Height = sbmp.Height + 2;
                bitmap.Id = def.Id;
                bitmaps.Add(bitmap);
            }

            Size bmpSize = ProcessRectangles(bitmaps);

            return CopyBitmapsToOutput(bitmaps, sourceBitmaps, outputBitmaps, bmpSize.Width, bmpSize.Height);
        }
예제 #3
0
        public void Convert(VexObject vo, DDW.Swf.SwfCompilationUnit scu)
        {
            curVo = vo;
            if (V2D.OUTPUT_TYPE == OutputType.Xna)
            {
                Gdi.GdiRenderer             gr   = new Gdi.GdiRenderer();
                Dictionary <string, Bitmap> bmps = gr.GenerateTimelineMappedBitmaps(vo);
                paths = gr.ExportBitmaps(bmps);
            }

            Init(scu);
            ParseActions(scu);
            ParseRootTimeline();
            GenerateActionData();
            GenerateJointData();

            string path = scu.FullPath;

            if (V2D.OUTPUT_TYPE == OutputType.Swf)
            {
                path = path.Replace(".swf", ".as");
                GenActionscript gas = new GenActionscript(this, path);
            }
            else
            {
                path = path.Replace(".swf", ".xml");
                GenXNA gx = new GenXNA(this, path, paths);
            }
        }
예제 #4
0
        public V2DContent GenerateBitamps()
        {
            string path = scu.FullPath;

            Gdi.GdiRenderer gr = new Gdi.GdiRenderer();
            gr.filterColor = outlineColor;
            gr.filterWidth = outlineWidth;
            Dictionary <string, List <Bitmap> > bmps = new Dictionary <string, List <Bitmap> >();

            gr.GenerateFilteredBitmaps(curVo, usedImages, bmps);
            //paths = gr.ExportBitmaps(bmps);
            gr.ExportBitmaps(bmps);
        }
예제 #5
0
        public void Convert(VexObject vo, DDW.Swf.SwfCompilationUnit scu)
        {
            curVo = vo;
            Init(scu);
            FilterMarkers();
            ParseActions(scu);
            ParseRootTimeline();
            ParseNamedDefinitions();
            GenerateWorldActionData();

            Gdi.GdiRenderer gr = new Gdi.GdiRenderer();
            Dictionary<string, List<Bitmap>> bmps = new Dictionary<string, List<Bitmap>>();
            gr.GenerateFilteredBitmaps(vo, usedImages, bmps);

            gr.ExportBitmapsAsPremultiplied(bmps);

            genV2d = new GenV2DWorld(this, usedImages);
            genV2d.Generate();
        }
예제 #6
0
파일: VexTree.cs 프로젝트: yzqlwt/Swf2XNA
        public void Convert(VexObject vo, DDW.Swf.SwfCompilationUnit scu)
        {
            curVo = vo;
            Init(scu);
            FilterMarkers();
            ParseActions(scu);
            ParseRootTimeline();
            ParseNamedDefinitions();
            GenerateWorldActionData();

            Gdi.GdiRenderer gr = new Gdi.GdiRenderer();
            Dictionary <string, List <Bitmap> > bmps = new Dictionary <string, List <Bitmap> >();

            gr.GenerateFilteredBitmaps(vo, usedImages, bmps);

            gr.ExportBitmapsAsPremultiplied(bmps);

            genV2d = new GenV2DWorld(this, usedImages);
            genV2d.Generate();
        }
예제 #7
0
 public V2DContent GenerateBitamps()
 {
     string path = scu.FullPath;
     Gdi.GdiRenderer gr = new Gdi.GdiRenderer();
     gr.filterColor = outlineColor;
     gr.filterWidth = outlineWidth;
     Dictionary<string, List<Bitmap>> bmps = new Dictionary<string, List<Bitmap>>();
     gr.GenerateFilteredBitmaps(curVo, usedImages, bmps);
     //paths = gr.ExportBitmaps(bmps);
     gr.ExportBitmaps(bmps);
 }