private void toolStripMenuItem_Resize_Click(object sender, EventArgs e) { IList <Project> selectedProjects = this.dataGridView.SelectedObjects(); if (selectedProjects.Count > 0) { DirectoryInfo imgRootDir = new DirectoryInfo(PathUtils.GetImgRootPath()); foreach (Project pro in selectedProjects) { if (pro == null || string.IsNullOrWhiteSpace(pro.id)) { continue; } string title = pro.name; MediaQueryCondition mediaQC = new MediaQueryCondition(); mediaQC.project_id = pro.id; IList <Media> medias = this.mediaDao.query(mediaQC); ResizeTask task = new ResizeTask(imgRootDir, title, medias, this, ResizeConfig.getInstance()); task.t.Start(); if (task.pb.ShowDialog(this) == DialogResult.Cancel) { task.stopflag = true; } } } else { return; } }
public async void Start() { // Settings modifiers this.settings.WindowlessFrameRate = 60; this.settings.BackgroundColor = 0x00; // CEF init with custom settings var cefSettings = new CefSettings(); cefSettings.CefCommandLineArgs["disable-extensions"] = "1"; cefSettings.CefCommandLineArgs["disable-gpu"] = "1"; cefSettings.CefCommandLineArgs["disable-gpu-compositing"] = "1"; cefSettings.CefCommandLineArgs["enable-begin-frame-scheduling"] = "1"; cefSettings.CefCommandLineArgs["enable-experimental-web-platform-features"] = "1"; cefSettings.CefCommandLineArgs["enable-media-stream"] = "1"; cefSettings.CefCommandLineArgs["enable-precise-memory-info"] = "1"; cefSettings.CefCommandLineArgs["autoplay-policy"] = "no-user-gesture-required"; cefSettings.CefCommandLineArgs.Remove("mute-audio"); Cef.Initialize(cefSettings); // Request context var reqCtxSettings = new RequestContextSettings { CachePath = "", IgnoreCertificateErrors = false, PersistSessionCookies = false, PersistUserPreferences = false, }; this.requestContext = new RequestContext(reqCtxSettings); // Browser window this.webBrowser = new ChromiumWebBrowser("about:blank", this.settings, this.requestContext, false); this.webBrowser.MenuHandler = this; this.webBrowser.LifeSpanHandler = this; CefSharpSettings.LegacyJavascriptBindingEnabled = true; this.webBrowser.RegisterAsyncJsObject("unityCaller", new BoundObject(this.runner)); this.webBrowser.CreateBrowser(); ResizeTask rz = new ResizeTask(startsize); // Resize and wait for init Resize(rz.width, rz.height); WaitForBrowserInit(); // Bind events this.webBrowser.Paint += WebBrowser_Paint; this.webBrowser.LoadError += WebBrowser_LoadError; this.webBrowser.LoadingStateChanged += WebBrowser_LoadingStateChanged; // Load initial page (TEST / TEMP) await LoadPageAsync(starturl); }
private void button_Resize_Click(object sender, EventArgs e) { this.saveConfig(); IList <Media> medias = mediaDao.queryAll(); DirectoryInfo imgRootDir = new DirectoryInfo(PathUtils.GetImgRootPath()); string title = "all"; ResizeTask task = new ResizeTask(imgRootDir, title, medias, this, ResizeConfig.getInstance()); task.t.Start(); if (task.pb.ShowDialog(this) == DialogResult.Cancel) { task.stopflag = true; } }
private void ResizeProjectSub(DirectoryInfo dir, string subName, Int32 smallWidth, Int32 smallHeight, Int32 mediumWidth, Int32 mediumHeight, string smallLogo, string mediumLogo, string largeLogo, bool waterMark) { DirectoryInfo[] floorplans = dir.GetDirectories(subName); if (floorplans.Length > 0) { DirectoryInfo floorplan = floorplans[0]; FileInfo[] files = floorplan.GetFiles(); //Image smallLogoImg = Bitmap.FromFile(smallLogo); //Image mediumLogoImg = Bitmap.FromFile(mediumLogo); //Image largeLogoImg = Bitmap.FromFile(largeLogo); ResizeTask s = new ResizeTask(dir, subName, files, this, smallWidth, smallHeight, mediumWidth, mediumHeight, smallLogo, mediumLogo, largeLogo, waterMark); s.t.Start(); if (s.pb.ShowDialog(this) == DialogResult.Cancel) { s.stopflag = true; } } }
private void toolStripMenuItem_Resize_Click(object sender, EventArgs e) { IList <Media> selectedMedias = this.dataGridView.SelectedObjects(); if (selectedMedias.Count > 0) { DirectoryInfo imgRootDir = new DirectoryInfo(PathUtils.GetImgRootPath()); string title = "selected"; ResizeTask task = new ResizeTask(imgRootDir, title, selectedMedias, this, ResizeConfig.getInstance()); task.t.Start(); if (task.pb.ShowDialog(this) == DialogResult.Cancel) { task.stopflag = true; } } else { return; } }