// // copied the source file by https://github.com/stackprobe/Factory/blob/master/SubTools/CopyLib.c // public static DDPicture GetPicture(string file) { if (PictureCache.ContainsKey(file) == false) { PictureCache.Add(file, DDPictureLoaders.Standard(file)); } return(PictureCache[file]); }
public void Test01() { DDPicture title_wall = DDPictureLoaders.Standard("title_wall.png"); for (; ;) { //DDDraw.DrawSimple(title_wall, 0, 0); DDDraw.DrawRect(title_wall, 0, 0, DDConsts.Screen_W, DDConsts.Screen_H); DDEngine.EachFrame(); } }
private IEnumerable <bool> GetLayer03(string imgFile) { DDPicture img = DDPictureLoaders.Standard(imgFile); // g double a = 0.0; double z = 2.0; double t1x = 100; double t2x = 100; double t3x = 100; for (int frmcnt = 0; ; frmcnt++) { DDDraw.DrawBegin(img, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2); DDDraw.DrawZoom(1.353); DDDraw.SetAlpha(a); DDDraw.DrawEnd(); DDDraw.DrawBegin(img, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2); DDDraw.DrawZoom(1.353 * z); DDDraw.SetAlpha(a / 2.0); DDDraw.DrawEnd(); I3Color color = new I3Color((int)(255 * a), (int)(255 * a), (int)(255 * a)); if (10 < frmcnt) { DDFontUtils.DrawString((int)(1000 + t1x), 620, "TOKYO", DDFontUtils.GetFont("Ink Free", 100), false, color); DDUtils.Approach(ref t1x, 0.0, 0.8); } if (15 < frmcnt) { DDFontUtils.DrawString((int)(1200 + t2x), 720, "LOVE", DDFontUtils.GetFont("Ink Free", 200), false, color); DDUtils.Approach(ref t2x, 0.0, 0.8); } if (20 < frmcnt) { DDFontUtils.DrawString((int)(1000 + t3x), 900, "STORY 1991", DDFontUtils.GetFont("Ink Free", 100), false, color); DDUtils.Approach(ref t3x, 0.0, 0.8); } DDUtils.Approach(ref a, 1.0, 0.98); DDUtils.Approach(ref z, 1.0, 0.98); yield return(true); } }
public static DDPicture GetPicutre(string file) { file = Path.Combine(@"Etoile\G4YokoActTM\Wall", file); DDPicture ret; if (Pictures.ContainsKey(file)) { ret = Pictures[file]; } else { ret = DDPictureLoaders.Standard(file); Pictures.Add(file, ret); } return(ret); }
private IEnumerable <bool> GetLayer02(string imgFile, int xDirSign) { DDPicture img = DDPictureLoaders.Standard(imgFile); // g double x = DDConsts.Screen_W * xDirSign; double y = -190.0; double a = 0.1; for (; ;) { DDDraw.DrawBegin(img, DDConsts.Screen_W / 2 + x, DDConsts.Screen_H / 2 + y); DDDraw.DrawZoom(1.353); DDDraw.SetAlpha(a); DDDraw.DrawEnd(); DDUtils.Approach(ref x, 0.0, 0.45); DDUtils.Approach(ref y, 190.0, 0.9); DDUtils.Approach(ref a, 1.0, 0.95); yield return(true); } }
private IEnumerable <bool> GetLayer01(string imgFile) { DDPicture img = DDPictureLoaders.Standard(imgFile); // g double y = -190.0; double b = 10000.0; double cLv = -1.0; for (; ;) { using (DDSubScreen workScreen = new DDSubScreen(DDConsts.Screen_W, DDConsts.Screen_H)) { DDSubScreenUtils.ChangeDrawScreen(workScreen); DDDraw.DrawBegin(img, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2 + y); DDDraw.DrawZoom(1.353); DDDraw.DrawEnd(); DX.GraphFilter(workScreen.GetHandle(), DX.DX_GRAPH_FILTER_GAUSS, 16, (int)b); // 1 DX.GraphFilter(workScreen.GetHandle(), DX.DX_GRAPH_FILTER_GAUSS, 16, (int)b); // 2 DX.GraphFilter(workScreen.GetHandle(), DX.DX_GRAPH_FILTER_GAUSS, 16, (int)b); // 3 DX.GraphFilter(workScreen.GetHandle(), DX.DX_GRAPH_FILTER_GAUSS, 16, (int)b); // 4 DX.GraphFilter(workScreen.GetHandle(), DX.DX_GRAPH_FILTER_GAUSS, 16, (int)b); // 5 DDSubScreenUtils.RestoreDrawScreen(); DDDraw.DrawSimple(DDPictureLoaders2.Wrapper(workScreen), 0, 0); } DDCurtain.DrawCurtain(cLv); DDUtils.Approach(ref y, 190.0, 0.9); DDUtils.Approach(ref b, 0.0, 0.7); DDUtils.Approach(ref cLv, 0.0, 0.8); yield return(true); } }
public void Perform(string spectrumFile, string jacketFile, string wDir, string cancelledFile, string successfulFile) { Ground.I.CancelledFile = cancelledFile; DDPicture jacket = DDPictureLoaders.Standard(jacketFile); // g DDResource.Load_DirectMode = true; jacket.GetHandle(); // pre-load DDResource.Load_DirectMode = false; new MovieGen0001().Main01( spectrumFile, jacket, wDir, 20, 12, 230, GetBarColor(), 0.6, 3.0 ); File.WriteAllBytes(successfulFile, BinTools.EMPTY); }
public void Main01(string rDir, string wDir) { this.RDir = rDir; this.WDir = wDir; if (Directory.Exists(this.RDir) == false) { throw new Exception("no RDir: " + this.RDir); } FileTools.Delete(this.WDir); FileTools.CreateDir(this.WDir); DDPicture jacket = DDPictureLoaders.Standard(Path.Combine(this.RDir, "Jacket.jpg")); // g this.SpData = new SpectrumData(Path.Combine(this.RDir, "Spectrum.csv")); double a = -1.0; double foa = 0.0; double xz = DDConsts.Screen_W * 1.0 / jacket.Get_W(); double yz = DDConsts.Screen_H * 1.0 / jacket.Get_H(); double bz1 = Math.Max(xz, yz); double bz2 = Math.Min(xz, yz); double z1 = 1.0; double z2 = 2.0; const int JACKET_MARGIN = 10; DDSubScreen workScreen = new DDSubScreen(DDConsts.Screen_W, DDConsts.Screen_H); // g DDSubScreen jacketScreen = new DDSubScreen(jacket.Get_W() + JACKET_MARGIN * 2, jacket.Get_H() + JACKET_MARGIN * 2, true); // g // ---- jacketScreen DDSubScreenUtils.ChangeDrawScreen(jacketScreen); DX.ClearDrawScreen(); DDDraw.DrawCenter(jacket, jacketScreen.GetSize().W / 2, jacketScreen.GetSize().H / 2); DDSubScreenUtils.RestoreDrawScreen(); // ---- SpectrumScreen0001 spScr = new SpectrumScreen0001(); while (this.Frame < this.SpData.Rows.Length) { double[] row = this.SpData.Rows[this.Frame]; // ---- workScreen DDSubScreenUtils.ChangeDrawScreen(workScreen); DDDraw.DrawBegin(jacket, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2); DDDraw.DrawZoom(bz1 * z1); DDDraw.DrawEnd(); DX.GraphFilter(workScreen.GetHandle(), DX.DX_GRAPH_FILTER_GAUSS, 16, 1000); DDSubScreenUtils.RestoreDrawScreen(); // ---- DDDraw.DrawSimple(workScreen.ToPicture(), 0, 0); DDCurtain.DrawCurtain(-0.5); DDDraw.DrawBegin( jacketScreen.ToPicture(), //jacket, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2); DDDraw.DrawZoom(bz2 * z2); DDDraw.DrawEnd(); DDCurtain.DrawCurtain(Math.Min(a, foa)); spScr.Draw(this.SpData.Rows[this.Frame]); DDDraw.SetAlpha(0.6); // ★要調整 DDDraw.DrawCenter(spScr.Screen.ToPicture(), DDConsts.Screen_W / 2, DDConsts.Screen_H - 110); DDDraw.Reset(); if (40 < this.Frame) { DDUtils.Approach(ref a, 0.0, 0.985); } if (this.SpData.Rows.Length - 40 < this.Frame) { DDUtils.Approach(ref foa, -1.0, 0.9); } //DDUtils.Approach(ref z1, 1.2, 0.999); z1 += 0.0001; DDUtils.Approach(ref z2, 1.0, 0.9985); this.MG_EachFrame(); } }
public void Main01(string rDir, string wRootDir, int spBarNum, int spBarWidth, int spBarHeight, I3Color spBarColor, double spBarAlpha, double z2 = 2.0) { string wLocalDir = string.Format("Bar={0:D2}_Bar-W={1:D2}_Bar-H={2:D3}_Bar-C={3}_Bar-A={4:F3}", spBarNum, spBarWidth, spBarHeight, spBarColor, spBarAlpha); this.RDir = rDir; this.WDir = Path.Combine(wRootDir, wLocalDir); if (Directory.Exists(this.RDir) == false) { throw new Exception("no RDir: " + this.RDir); } FileTools.Delete(this.WDir); FileTools.CreateDir(this.WDir); DDPicture jacket = DDPictureLoaders.Standard(Path.Combine(this.RDir, "Jacket.jpg")); // g this.SpData = new SpectrumData(Path.Combine(this.RDir, "Spectrum.csv")); double a = -1.0; double foa = 0.0; double xz = DDConsts.Screen_W * 1.0 / jacket.Get_W(); double yz = DDConsts.Screen_H * 1.0 / jacket.Get_H(); double bz1 = Math.Max(xz, yz); double bz2 = Math.Min(xz, yz); double z1 = 1.0; //double z2 = 2.0; // 引数化 @ 2020.7.19 const int JACKET_MARGIN = 10; DDSubScreen workScreen = new DDSubScreen(DDConsts.Screen_W, DDConsts.Screen_H); // g DDSubScreen jacketScreen = new DDSubScreen(jacket.Get_W() + JACKET_MARGIN * 2, jacket.Get_H() + JACKET_MARGIN * 2, true); // g // ---- jacketScreen DDSubScreenUtils.ChangeDrawScreen(jacketScreen); DX.ClearDrawScreen(); DDDraw.DrawCenter(jacket, jacketScreen.GetSize().W / 2, jacketScreen.GetSize().H / 2); DDSubScreenUtils.RestoreDrawScreen(); // ---- SpectrumScreen0001 spScr = new SpectrumScreen0001(spBarNum, spBarWidth, spBarHeight, spBarColor); while (this.Frame < this.SpData.Rows.Length) { double[] row = this.SpData.Rows[this.Frame]; // ---- workScreen DDSubScreenUtils.ChangeDrawScreen(workScreen); DDDraw.DrawBegin(jacket, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2); DDDraw.DrawZoom(bz1 * z1); DDDraw.DrawEnd(); DX.GraphFilter(workScreen.GetHandle(), DX.DX_GRAPH_FILTER_GAUSS, 16, 1000); DDSubScreenUtils.RestoreDrawScreen(); // ---- DDDraw.DrawSimple(workScreen.ToPicture(), 0, 0); DDCurtain.DrawCurtain(-0.5); DDDraw.DrawBegin( jacketScreen.ToPicture(), //jacket, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2); DDDraw.DrawZoom(bz2 * z2); DDDraw.DrawEnd(); DDCurtain.DrawCurtain(Math.Min(a, foa)); spScr.Draw(this.SpData.Rows[this.Frame]); DDDraw.SetAlpha(spBarAlpha); // ★要調整 DDDraw.DrawCenter(spScr.Screen.ToPicture(), DDConsts.Screen_W / 2, DDConsts.Screen_H - spBarHeight / 2 - 10); DDDraw.Reset(); if (40 < this.Frame) { DDUtils.Approach(ref a, 0.0, 0.985); } if (this.SpData.Rows.Length - 40 < this.Frame) { DDUtils.Approach(ref foa, -1.0, 0.9); } //DDUtils.Approach(ref z1, 1.2, 0.999); //z1 += 0.0001; DDUtils.Approach(ref z2, 1.0, 0.9985); this.MG_EachFrame(); } // ゴミ内のハンドルだけでも開放する。 { DDPictureUtils.UnloadAll(); DDSubScreenUtils.UnloadAll(); } }
public void Test01() { DDPicture title_wall = DDPictureLoaders.Standard("title_wall.png"); title_wall.GetHandle(); }