private static void DrawWall() { DDUtils.Approach(ref WallBokashiRate, WallBokashiRateDest, 0.93); DDUtils.Approach(ref WallZRate, WallZRateDest, 0.9); // --- DDSubScreenUtils.ChangeDrawScreen(WorkScreen); DDDraw.DrawBegin(Ground.I.Picture.TitleWall, DDConsts.Screen_W / 2.0, DDConsts.Screen_H / 2.0); DDDraw.DrawZoom(WallZRate); DDDraw.DrawEnd(); DX.GraphFilter(WorkScreen.GetHandle(), DX.DX_GRAPH_FILTER_GAUSS, 16, DoubleTools.ToInt(WallBokashiRate * 1000.0)); // 1 DX.GraphFilter(WorkScreen.GetHandle(), DX.DX_GRAPH_FILTER_GAUSS, 16, DoubleTools.ToInt(WallBokashiRate * 1000.0)); // 2 DDSubScreenUtils.RestoreDrawScreen(); DDDraw.DrawSimple(DDPictureLoaders2.Wrapper(WorkScreen), 0, 0); }
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 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 Draw(double[] spectra) { if (spectra.Length != Consts.SPECTRA_LEN) { throw null; } if (this.ShadowSpectra == null) { this.ShadowSpectra = new ShadowSpectraData(); } this.ShadowSpectra.Projection(spectra); DDSubScreenUtils.ChangeDrawScreen(this.GraphScreen); DX.ClearDrawScreen(); for (int layer = 0; layer < 2; layer++) { for (int bi = 0; bi < this.BarNum; bi++) { int c1 = (Consts.SPECTRA_LEN * (bi + 0)) / this.BarNum; int c2 = (Consts.SPECTRA_LEN * (bi + 1)) / this.BarNum; double v = 0.0; for (int c = c1; c < c2; c++) { v += (layer == 0 ? this.ShadowSpectra.ShadowSpectra : spectra)[c]; } v /= c2 - c1; int x1 = ((this.GraphScreen.GetSize().W - this.Bar_W) * bi) / (this.BarNum - 1); int x2 = x1 + this.Bar_W; int y1 = (int)((1.0 - v) * this.GraphScreen.GetSize().H); int y2 = this.GraphScreen.GetSize().H; if (y1 + 1 < y2) { double bright = layer == 0 ? 0.5 : 1.0; DDDraw.SetBright( bright * (this.BarColor.R / 255.0), bright * (this.BarColor.G / 255.0), bright * (this.BarColor.B / 255.0) ); DDDraw.DrawRect(DDGround.GeneralResource.WhiteBox, x1, y1, x2 - x1, y2 - y1); DDDraw.Reset(); } } } DDSubScreenUtils.ChangeDrawScreen(this.Screen); DX.ClearDrawScreen(); for (int c = 0; c < 2; c++) { DDDraw.DrawBegin(this.GraphScreen.ToPicture(), this.Screen.GetSize().W / 2, this.Screen.GetSize().H / 2); DDDraw.SetBright(0, 0, 0); DDDraw.DrawEnd(); DDDraw.Reset(); DX.GraphFilter(this.Screen.GetHandle(), DX.DX_GRAPH_FILTER_GAUSS, 16, 1000); } DDDraw.DrawCenter(this.GraphScreen.ToPicture(), this.Screen.GetSize().W / 2, this.Screen.GetSize().H / 2); DDSubScreenUtils.RestoreDrawScreen(); }
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 Draw(double[] spectra) { if (spectra.Length != 90) { throw null; // souteigai !!! } if (this.ShadowSpectra == null) { this.ShadowSpectra = new ShadowSpectraData(); } this.ShadowSpectra.Projection(spectra); DDSubScreenUtils.ChangeDrawScreen(this.GraphScreen); DX.ClearDrawScreen(); for (int c = 0; c < 30; c++) { double v = this.ShadowSpectra.ShadowSpectra[c * 3 + 0] + this.ShadowSpectra.ShadowSpectra[c * 3 + 1] + this.ShadowSpectra.ShadowSpectra[c * 3 + 2]; v /= 3.0; int x1 = c * 30; int x2 = x1 + 10; int y1 = (int)((1.0 - v) * 600); int y2 = 600; if (y1 + 1 < y2) { DDDraw.SetBright(0.4, 0.5, 0.6); DDDraw.DrawRect(DDGround.GeneralResource.WhiteBox, x1, y1, x2 - x1, y2 - y1); DDDraw.Reset(); } } for (int c = 0; c < 30; c++) { double v = spectra[c * 3 + 0] + spectra[c * 3 + 1] + spectra[c * 3 + 2]; v /= 3.0; int x1 = c * 30; int x2 = x1 + 10; int y1 = (int)((1.0 - v) * 600); int y2 = 600; if (y1 + 1 < y2) { DDDraw.DrawRect(DDGround.GeneralResource.WhiteBox, x1, y1, x2 - x1, y2 - y1); } } DDDraw.DrawRect(DDGround.GeneralResource.WhiteBox, 0, 620, 880, 10); DDFontUtils.DrawString(0, 640, "小田和正", DDFontUtils.GetFont("メイリオ", 80)); DDFontUtils.DrawString(270, 740, "ラブ・ストーリーは突然に", DDFontUtils.GetFont("メイリオ", 50)); DDFontUtils.DrawString(30, 840, "『 東京ラブストーリー ( 1991 ) 』 主題歌", DDFontUtils.GetFont("メイリオ", 40)); DDSubScreenUtils.ChangeDrawScreen(this.Screen); DX.ClearDrawScreen(); DDDraw.DrawBegin(DDPictureLoaders2.Wrapper(this.GraphScreen), 500, 500); DDDraw.SetBright(0, 0, 0); DDDraw.DrawEnd(); DDDraw.Reset(); DX.GraphFilter(this.Screen.GetHandle(), DX.DX_GRAPH_FILTER_GAUSS, 16, 1000); DDDraw.DrawCenter(DDPictureLoaders2.Wrapper(this.GraphScreen), 500, 500); DDSubScreenUtils.RestoreDrawScreen(); }
public static void TitleMain() { WorkScreen = new DDSubScreen(DDConsts.Screen_W, DDConsts.Screen_H); foreach (DDScene scene in DDSceneUtils.Create(30)) { DDCurtain.DrawCurtain(); DDEngine.EachFrame(); } foreach (DDScene scene in DDSceneUtils.Create(30)) { double a = -1.0 + scene.Rate; DDDraw.DrawBegin(Ground.I.Picture.Logo, DDConsts.Screen_W / 2.0, DDConsts.Screen_H / 2.0); DDDraw.DrawZoom(1.0 + a * a * 0.1); DDDraw.DrawEnd(); //DDDraw.DrawSimple(Ground.I.Picture.Logo, 0, 0); DDCurtain.DrawCurtain(a); DDEngine.EachFrame(); } foreach (DDScene scene in DDSceneUtils.Create(60)) { DDDraw.DrawSimple(Ground.I.Picture.Logo, 0, 0); DDEngine.EachFrame(); } foreach (DDScene scene in DDSceneUtils.Create(30)) { double a = -scene.Rate; DDDraw.DrawBegin(Ground.I.Picture.Logo, DDConsts.Screen_W / 2.0, DDConsts.Screen_H / 2.0); DDDraw.DrawZoom(1.0 + a * a * 0.1); DDDraw.DrawEnd(); //DDDraw.DrawSimple(Ground.I.Picture.Logo, 0, 0); DDCurtain.DrawCurtain(a); DDEngine.EachFrame(); } foreach (DDScene scene in DDSceneUtils.Create(30)) { DDCurtain.DrawCurtain(); DDEngine.EachFrame(); } const int TITLE_BTN_START_X = 130; const int TITLE_BTN_START_Y = 460; const int TITLE_BTN_CONFIG_X = 830; const int TITLE_BTN_CONFIG_Y = 70; const int TITLE_BTN_EXIT_X = 830; const int TITLE_BTN_EXIT_Y = 460; { double a = 0.0; double z = 1.3; bool titleBackOn = false; double titleBackA = 0.0; double titleBackZ = 0.1; bool titleOn = false; double titleA = 0.0; double titleZ = 1.3; bool[] titleBtnsOn = new bool[] { false, false, false }; double[] titleBtnsA = new double[3] { 0, 0, 0 }; double[] titleBtnsZ = new double[3] { 1.05, 1.1, 1.15 }; foreach (DDScene scene in DDSceneUtils.Create(120)) { if (scene.Numer == 30) { titleBackOn = true; } if (scene.Numer == 60) { titleOn = true; } if (scene.Numer == 90) { titleBtnsOn[0] = true; } if (scene.Numer == 100) { titleBtnsOn[1] = true; } if (scene.Numer == 110) { titleBtnsOn[2] = true; } DDCurtain.DrawCurtain(); // Wall > DDSubScreenUtils.ChangeDrawScreen(WorkScreen.GetHandle()); DDDraw.SetAlpha(a); DDDraw.DrawBegin(Ground.I.Picture.TitleWall, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2); DDDraw.DrawZoom(z); DDDraw.DrawEnd(); DDDraw.Reset(); DX.GraphFilter(WorkScreen.GetHandle(), DX.DX_GRAPH_FILTER_GAUSS, 16, 1000); // 1 DX.GraphFilter(WorkScreen.GetHandle(), DX.DX_GRAPH_FILTER_GAUSS, 16, 1000); // 2 DDSubScreenUtils.RestoreDrawScreen(); DDDraw.DrawSimple(DDPictureLoaders2.Wrapper(WorkScreen), 0, 0); // < Wall DDDraw.SetAlpha(titleBackA); DDDraw.SetBright(0, 0, 0); DDDraw.DrawBeginRect(DDGround.GeneralResource.WhiteBox, TITLE_BACK_L, TITLE_BACK_T, TITLE_BACK_W, TITLE_BACK_H); DDDraw.DrawZoom_X(titleBackZ); DDDraw.DrawEnd(); DDDraw.Reset(); DDDraw.SetAlpha(titleA); DDDraw.DrawBegin(Ground.I.Picture.Title, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2); DDDraw.DrawZoom(titleZ); DDDraw.DrawEnd(); DDDraw.Reset(); DDDraw.SetAlpha(titleBtnsA[0]); DDDraw.DrawBegin(Ground.I.Picture.TitleBtnStart, TITLE_BTN_START_X, TITLE_BTN_START_Y); DDDraw.DrawZoom(titleBtnsZ[0]); DDDraw.DrawEnd(); DDDraw.Reset(); DDDraw.SetAlpha(titleBtnsA[1]); DDDraw.DrawBegin(Ground.I.Picture.TitleBtnConfig, TITLE_BTN_CONFIG_X, TITLE_BTN_CONFIG_Y); DDDraw.DrawZoom(titleBtnsZ[1]); DDDraw.DrawEnd(); DDDraw.Reset(); DDDraw.SetAlpha(titleBtnsA[2]); DDDraw.DrawBegin(Ground.I.Picture.TitleBtnExit, TITLE_BTN_EXIT_X, TITLE_BTN_EXIT_Y); DDDraw.DrawZoom(titleBtnsZ[2]); DDDraw.DrawEnd(); DDDraw.Reset(); DDUtils.Approach(ref a, 1.0, 0.97); DDUtils.Approach(ref z, 1.0, 0.95); if (titleBackOn) { DDUtils.Approach(ref titleBackA, TITLE_BACK_A, 0.95); DDUtils.Approach(ref titleBackZ, 1.0, 0.9); } if (titleOn) { DDUtils.Approach(ref titleA, 1.0, 0.93); DDUtils.Approach(ref titleZ, 1.0, 0.8); } for (int c = 0; c < 3; c++) { if (titleBtnsOn[c]) { DDUtils.Approach(ref titleBtnsA[c], 1.0, 0.77); DDUtils.Approach(ref titleBtnsZ[c], 1.0, 0.73); } } DDEngine.EachFrame(); } } { double selRateStart = 0.0; double selRateConfig = 0.0; double selRateExit = 0.0; returned: DDEngine.FreezeInput(); WallBokashiRateDest = 1.0; P_TitleBackWDest = TITLE_BACK_W; for (; ;) { DrawWall(); DrawTitleBack(); DDDraw.DrawCenter(Ground.I.Picture.Title, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2); DDDraw.DrawBegin(Ground.I.Picture.TitleBtnStart, TITLE_BTN_START_X, TITLE_BTN_START_Y); DDDraw.DrawZoom(1.0 + selRateStart * 0.2); DDDraw.DrawEnd(); NamedCrashMgr.AddLastDrawedCrash("START"); DDDraw.DrawBegin(Ground.I.Picture.TitleBtnConfig, TITLE_BTN_CONFIG_X, TITLE_BTN_CONFIG_Y); DDDraw.DrawZoom(1.0 + selRateConfig * 0.15); DDDraw.DrawEnd(); NamedCrashMgr.AddLastDrawedCrash("CONFIG"); DDDraw.DrawBegin(Ground.I.Picture.TitleBtnExit, TITLE_BTN_EXIT_X, TITLE_BTN_EXIT_Y); DDDraw.DrawZoom(1.0 + selRateExit * 0.15); DDDraw.DrawEnd(); NamedCrashMgr.AddLastDrawedCrash("EXIT"); // <---- 描画 DDMouse.UpdatePos(); string pointingName = NamedCrashMgr.GetName(DDMouse.X, DDMouse.Y); if (pointingName == "START") { DDUtils.Approach(ref selRateStart, 1.0, 0.85); } else { DDUtils.Approach(ref selRateStart, 0.0, 0.9); } if (pointingName == "CONFIG") { DDUtils.Approach(ref selRateConfig, 1.0, 0.9); } else { DDUtils.Approach(ref selRateConfig, 0.0, 0.93); } if (pointingName == "EXIT") { DDUtils.Approach(ref selRateExit, 1.0, 0.9); } else { DDUtils.Approach(ref selRateExit, 0.0, 0.93); } DDEngine.EachFrame(); // ★★★ EachFrame if (DDMouse.L.GetInput() == 1) { if (pointingName == "EXIT") { break; } if (pointingName == "CONFIG") { TitleConfig(); goto returned; } if (pointingName == "START") { TitleDDStart(); selRateStart = 0.0; selRateExit = 1.0; goto returned; } } } } DDCurtain.SetCurtain(30, -1.0); DDMusicUtils.Fade(); foreach (DDScene scene in DDSceneUtils.Create(40)) { DrawWall(); DDEngine.EachFrame(); } }
public void Main01(string spectrumFile, DDPicture jacket, string wDir, int spBarNum, int spBarWidth, int spBarHeight, I3Color spBarColor, double spBarAlpha, double z2) { FileTools.Delete(wDir); FileTools.CreateDir(wDir); this.SpData = new SpectrumData(spectrumFile); 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; using (DDSubScreen pseudoMainScreen = new DDSubScreen( DDConsts.Screen_W, DDConsts.Screen_H )) using (DDSubScreen workScreen = new DDSubScreen( DDConsts.Screen_W, DDConsts.Screen_H )) using (DDSubScreen jacketScreen = new DDSubScreen( jacket.Get_W() + JACKET_MARGIN * 2, jacket.Get_H() + JACKET_MARGIN * 2, true )) { // ---- 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]; spScr.Draw(row); // ---- 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(); // ---- pseudoMainScreen DDSubScreenUtils.ChangeDrawScreen(pseudoMainScreen); 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)); DDDraw.SetAlpha(spBarAlpha); DDDraw.DrawCenter(spScr.Screen.ToPicture(), DDConsts.Screen_W / 2, DDConsts.Screen_H - spBarHeight / 2 - 10); DDDraw.Reset(); // ここでフレームを保存 DX.SaveDrawScreenToJPEG(0, 0, DDConsts.Screen_W, DDConsts.Screen_H, Path.Combine(wDir, string.Format("{0}.jpg", this.Frame)), Consts.JPEG_QUALITY); //DX.SaveDrawScreen(0, 0, DDConsts.Screen_W, DDConsts.Screen_H, Path.Combine(wDir, string.Format("{0}.bmp", this.Frame))); DDSubScreenUtils.RestoreDrawScreen(); // ---- 以降、フレーム毎の処理 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); if (this.Frame % 30 == 0) // 毎回やる必要は無い。 { DDCurtain.DrawCurtain(); DDPrint.SetPrint(16, 16, 32); DDPrint.SetBorder(new I3Color(0, 64, 128)); DDPrint.PrintLine("ConvGenVideo"); //DDPrint.PrintLine("ConvGenVideo [Version " + DDUserDatStrings.Version + "]"); DDPrint.PrintLine("映像を生成しています..."); DDPrint.PrintLine("右上の[X]ボタンを押すと全ての処理を中止(キャンセル)します。"); { double rate = this.Frame * 1.0 / this.SpData.Rows.Length; const int PROGRESS_BAR_H = 10; DDDraw.DrawRect(DDGround.GeneralResource.WhiteBox, 0, (DDConsts.Screen_H - PROGRESS_BAR_H) / 2, Math.Max(5, DDConsts.Screen_W * rate), PROGRESS_BAR_H); } DDEngine.EachFrame(); } this.Frame++; } } }
public void Draw(double[] spectra) { if (spectra.Length != 90) { throw null; // souteigai !!! } if (this.ShadowSpectra == null) { this.ShadowSpectra = new ShadowSpectraData(); } this.ShadowSpectra.Projection(spectra); DDSubScreenUtils.ChangeDrawScreen(this.GraphScreen); DX.ClearDrawScreen(); for (int c = 0; c < 10; c++) { double v = this.ShadowSpectra.ShadowSpectra[c * 9 + 0] + this.ShadowSpectra.ShadowSpectra[c * 9 + 1] + this.ShadowSpectra.ShadowSpectra[c * 9 + 2] + this.ShadowSpectra.ShadowSpectra[c * 9 + 3] + this.ShadowSpectra.ShadowSpectra[c * 9 + 4] + this.ShadowSpectra.ShadowSpectra[c * 9 + 5] + this.ShadowSpectra.ShadowSpectra[c * 9 + 6] + this.ShadowSpectra.ShadowSpectra[c * 9 + 7] + this.ShadowSpectra.ShadowSpectra[c * 9 + 8]; v /= 9.0; v *= 10.0; int iv = DoubleTools.ToInt(v); for (int d = 0; d < iv; d++) { int x1 = (c + 0) * 160; int x2 = (c + 1) * 160; int y1 = (d + 0) * 40; int y2 = (d + 1) * 40; x1 += 5; x2 -= 5; y1 += 3; y2 -= 3; DDDraw.SetBright(0.6, 0.4, 0.4); DDDraw.DrawRect(DDGround.GeneralResource.WhiteBox, x1, y1, x2 - x1, y2 - y1); DDDraw.Reset(); } } for (int c = 0; c < 10; c++) { double v = spectra[c * 9 + 0] + spectra[c * 9 + 1] + spectra[c * 9 + 2] + spectra[c * 9 + 3] + spectra[c * 9 + 4] + spectra[c * 9 + 5] + spectra[c * 9 + 6] + spectra[c * 9 + 7] + spectra[c * 9 + 8]; v /= 9.0; v *= 10.0; int iv = DoubleTools.ToInt(v); for (int d = 0; d < iv; d++) { int x1 = (c + 0) * 160; int x2 = (c + 1) * 160; int y1 = (d + 0) * 40; int y2 = (d + 1) * 40; x1 += 5; x2 -= 5; y1 += 3; y2 -= 3; DDDraw.SetBright(1.0, 0.8, 0.8); DDDraw.DrawRect(DDGround.GeneralResource.WhiteBox, x1, y1, x2 - x1, y2 - y1); DDDraw.Reset(); } } DDSubScreenUtils.ChangeDrawScreen(this.Screen); DX.ClearDrawScreen(); DDDraw.DrawBegin(DDPictureLoaders2.Wrapper(this.GraphScreen), this.Screen.GetSize().W / 2, this.Screen.GetSize().H / 2); DDDraw.SetBright(0, 0, 0); DDDraw.DrawEnd(); DDDraw.Reset(); DX.GraphFilter(this.Screen.GetHandle(), DX.DX_GRAPH_FILTER_GAUSS, 16, 1000); DDDraw.DrawCenter(DDPictureLoaders2.Wrapper(this.GraphScreen), this.Screen.GetSize().W / 2, this.Screen.GetSize().H / 2); DDSubScreenUtils.RestoreDrawScreen(); }
public void Draw(double[] spectra) { if (spectra.Length != 90) { throw null; // souteigai !!! } if (this.ShadowSpectra == null) { this.ShadowSpectra = new ShadowSpectraData(); } this.ShadowSpectra.Projection(spectra); DDSubScreenUtils.ChangeDrawScreen(this.GraphScreen); DX.ClearDrawScreen(); for (int c = 0; c < 10; c++) { double v = this.ShadowSpectra.ShadowSpectra[c * 9 + 0] + this.ShadowSpectra.ShadowSpectra[c * 9 + 1] + this.ShadowSpectra.ShadowSpectra[c * 9 + 2] + this.ShadowSpectra.ShadowSpectra[c * 9 + 3] + this.ShadowSpectra.ShadowSpectra[c * 9 + 4] + this.ShadowSpectra.ShadowSpectra[c * 9 + 5] + this.ShadowSpectra.ShadowSpectra[c * 9 + 6] + this.ShadowSpectra.ShadowSpectra[c * 9 + 7] + this.ShadowSpectra.ShadowSpectra[c * 9 + 8]; v /= 9.0; int x1 = c * 100; int x2 = x1 + 10; int y1 = (int)((1.0 - v) * this.GraphScreen.GetSize().H); int y2 = this.GraphScreen.GetSize().H; if (y1 + 1 < y2) { DDDraw.SetBright(0.4, 0.5, 0.6); DDDraw.DrawRect(DDGround.GeneralResource.WhiteBox, x1, y1, x2 - x1, y2 - y1); DDDraw.Reset(); } } for (int c = 0; c < 10; c++) { double v = spectra[c * 9 + 0] + spectra[c * 9 + 1] + spectra[c * 9 + 2] + spectra[c * 9 + 3] + spectra[c * 9 + 4] + spectra[c * 9 + 5] + spectra[c * 9 + 6] + spectra[c * 9 + 7] + spectra[c * 9 + 8]; v /= 9.0; int x1 = c * 100; int x2 = x1 + 10; int y1 = (int)((1.0 - v) * this.GraphScreen.GetSize().H); int y2 = this.GraphScreen.GetSize().H; if (y1 + 1 < y2) { DDDraw.DrawRect(DDGround.GeneralResource.WhiteBox, x1, y1, x2 - x1, y2 - y1); } } DDSubScreenUtils.ChangeDrawScreen(this.Screen); DX.ClearDrawScreen(); for (int c = 0; c < 2; c++) { DDDraw.DrawBegin(this.GraphScreen.ToPicture(), this.Screen.GetSize().W / 2, this.Screen.GetSize().H / 2); DDDraw.SetBright(0, 0, 0); DDDraw.DrawEnd(); DDDraw.Reset(); DX.GraphFilter(this.Screen.GetHandle(), DX.DX_GRAPH_FILTER_GAUSS, 16, 1000); } DDDraw.DrawCenter(this.GraphScreen.ToPicture(), this.Screen.GetSize().W / 2, this.Screen.GetSize().H / 2); DDSubScreenUtils.RestoreDrawScreen(); }
public void Main01(string spectrumFile, DDPicture jacket, string wDir, int spBarNum, int spBarWidth, int spBarHeight, I3Color spBarColor, double spBarAlpha, double z2) { FileTools.Delete(wDir); FileTools.CreateDir(wDir); this.SpData = new SpectrumData(spectrumFile); 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; using (DDSubScreen pseudoMainScreen = new DDSubScreen( DDConsts.Screen_W, DDConsts.Screen_H )) using (DDSubScreen workScreen = new DDSubScreen( DDConsts.Screen_W, DDConsts.Screen_H )) using (DDSubScreen jacketScreen = new DDSubScreen( jacket.Get_W() + JACKET_MARGIN * 2, jacket.Get_H() + JACKET_MARGIN * 2, true )) { // ---- 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]; spScr.Draw(row); // ---- 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(); // ---- pseudoMainScreen DDSubScreenUtils.ChangeDrawScreen(pseudoMainScreen); 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)); DDDraw.SetAlpha(spBarAlpha); DDDraw.DrawCenter(spScr.Screen.ToPicture(), DDConsts.Screen_W / 2, DDConsts.Screen_H - spBarHeight / 2 - 10); DDDraw.Reset(); // ここでフレームを保存 DX.SaveDrawScreen(0, 0, DDConsts.Screen_W, DDConsts.Screen_H, Path.Combine(wDir, string.Format("{0}.bmp", this.Frame))); DDSubScreenUtils.RestoreDrawScreen(); // ---- 実際に表示される画面の描画 DDCurtain.DrawCurtain(); { double rate = this.Frame * 1.0 / this.SpData.Rows.Length; const int PROGRESS_BAR_H = 10; DDDraw.DrawRect(DDGround.GeneralResource.WhiteBox, 0, (DDConsts.Screen_H - PROGRESS_BAR_H) / 2, Math.Max(5, DDConsts.Screen_W * rate), PROGRESS_BAR_H); } // ---- 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(); } } }