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)); }
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); }
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); } }
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); }
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(); }
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(); }
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); }