private static void DrawStartOids(OIDProject oIDProject, Scene scene, TTToolSettings set, string workdir, Bitmap maskPicture, Graphics graphic, bool highquality) { if (scene.StartOid != null && scene.StartOid.Polygons != null && scene.StartOid.Polygons.Count > 0) { set.CodeDim = new Size(1, 1); var res = TTTool.CreateOidCodes(set, oIDProject.ProductID, workdir); var MaskImage = Bitmap.FromFile(res); DrawPolygons(maskPicture, graphic, scene.StartOid, MaskImage, highquality); } }
private static void DrawSeceneOids(OIDProject oIDProject, Scene scene, TTToolSettings set, string workdir, Bitmap maskPicture, Graphics graphic, bool highquality) { foreach (SceneOid sc in scene.SceneOids) { var ns = oIDProject.nodeSetups.Where(x => x.Name == sc.SetupName).FirstOrDefault(); set.CodeDim = new Size(1, 1); var res = TTTool.CreateOidCodes(set, (short)ns.OID, workdir); var MaskImage = Bitmap.FromFile(res); DrawPolygons(maskPicture, graphic, sc, MaskImage, highquality); } }
public string CreateGME() { var yaml = $"{Path.Combine(ProjectPath, Name)}_build.yaml"; using (var fileStream = new FileStream(yaml, FileMode.Create, FileAccess.Write)) { using (StreamWriter writer = new StreamWriter(fileStream)) { writer.WriteLine(CreateYaml()); } } var gme = $"{Path.Combine(ProjectPath, Name)}.gme"; TTTool.Assemble(yaml, gme); return(gme); }
private static void DrawAllOids(OIDProject oIDProject, Scene scene, TTToolSettings set, string workdir, Bitmap maskPicture, Graphics graphic, bool highquality) { var allOids = new List <SceneOid>(); allOids.AddRange(scene.SceneOids); if (scene.StartOid != null && scene.StartOid.Polygons != null && scene.StartOid.Polygons.Count > 0) { allOids.Add(scene.StartOid); } foreach (SceneOid sc in allOids) { var ns = oIDProject.nodeSetups.Where(x => x.Name == sc.SetupName).FirstOrDefault(); set.CodeDim = new Size(1, 1); var res = TTTool.CreateOidCodes(set, (ushort)(ns != null ? ns.OID: oIDProject.ProductID), workdir); var MaskImage = Bitmap.FromFile(res); DrawPolygons(maskPicture, graphic, sc, MaskImage, highquality); } }