void Start() { StartCoroutine(CheckPermission()); for (int i = 0; i < WebCamTexture.devices.Length; i++) { UIManager.PrintDebugText(WebCamTexture.devices[i].name + " -- " + WebCamTexture.devices[i].isFrontFacing.ToString()); } Vector2 currentRes = new Vector2(Screen.currentResolution.width, Screen.currentResolution.height); UIManager.PrintDebugText("currentRes is: " + currentRes.ToString()); Globals.PostProductionMaterial.SetVector(flipUVID, new Vector4(1, 0, 0, 0)); Globals.PostProductionMaterial.SetVector(screenTexelSizeID, new Vector4(1.0f / currentRes.x, 1.0f / currentRes.y, currentRes.x, currentRes.y)); //bulk initialization, rethink currentCCPreset = Globals.ColorCorrectionPreset[0]; currentPhotoFrame = Globals.PhotoFrames[0]; currentResolution = Globals.Resolutions[1]; InitializeFisheye(); InitializeRGBDistortion(); SetupColorCorrection(); InitializeLuminanceFilter(); squareSide = (int)Mathf.Min(currentRes.x, currentRes.y); InitializeCameraDevice(); }
private void Click(object sender) { PhotoFrame p = sender as PhotoFrame; CouponsShowWindow showWindow = new CouponsShowWindow(); showWindow.viewModel.CouponsModel = p.SlipInfo; showWindow.DataBinding(); showWindow.Width = 1080; showWindow.Height = 1000; showWindow.Top = 0; showWindow.Left = 0; showWindow.Show(); }
private async void Save_Click(object sender, RoutedEventArgs e) { if (myPassward.Password != App.thisuser.Password && myPassword2.Password == myPassward.Password) { var Announcement = await Database.Context.Users.SingleOrDefaultAsync(m => m.Id == App.thisuser.Id); if (Announcement != null) { Announcement.Password = myPassword2.Password; await Database.Context.SaveChangesAsync(); } PhotoFrame.Navigate(typeof(Photo)); } }
private void Click(object sender) { PhotoFrame p = sender as PhotoFrame; if (showWindow != null && nowState != SeatManage.EnumType.SendClentMessageType.Normal) { showWindow.Close(); showWindow = null; } showWindow = new CouponsShowWindow(); showWindow.viewModel.CouponsModel = p.SlipInfo; showWindow.DataBinding(); showWindow.Width = 1080; showWindow.Height = 920; showWindow.Top = 0; showWindow.Left = 0; showWindow.Show(); //showWindow = null; }
public void SaveProjectFile() { if (!IsPhotoWorkshopProject) { new Exception("The file name is incorrect"); } FileStream fs = new FileStream(filename, FileMode.Create); XmlTextWriter xmlOut = new XmlTextWriter(fs, Encoding.Unicode); xmlOut.Formatting = Formatting.Indented; xmlOut.WriteStartDocument(); xmlOut.WriteComment("CyD Software Labs - DPhotoWorkshop (www.dphotoworkshop.com)"); xmlOut.WriteComment("Be carifully to edit the file manually"); xmlOut.WriteStartElement("PhotoWorkshopProject"); xmlOut.WriteAttributeString("Version", "1"); SavePictureToFile(xmlOut); SaveProjectPropertiesToFile(xmlOut); if (PhotoFrame != null) { PhotoFrame.SaveToFile(xmlOut); } foreach (Object item in imageCanvas.Children) { if (item is DesignerBaseItem) { (item as DesignerBaseItem).SaveToFile(xmlOut); } } xmlOut.WriteEndElement(); xmlOut.WriteEndDocument(); xmlOut.Close(); fs.Close(); Modified = false; }
//void ad_SCStart(object sender, EventArgs e) //{ // this.Dispatcher.Invoke(new Action(() => // { // try // { // if (ad.SCModel.Count > 0) // { // InitImgpanel(); // //ad.imageUrlChange();//广告每隔4秒进行一次切换 // //imgPanel1.Visibility = Visibility.Visible; // imgPanel2.Visibility = Visibility.Visible; // if (canva1.Visibility == Visibility.Visible) // { // mediaPlayHost.Height = 607; // myMediaPlayer.Height = 607; // imgCanv.Height = 607; // Canvas.SetTop(canva1, 607); // } // else // { // mediaPlayHost.Height = 763; // myMediaPlayer.Height = 763; // imgCanv.Height = 763; // } // } // } // catch (Exception ex) // { // SeatManage.SeatManageComm.WriteLog.Write(ex.Message.TrimEnd('\0')); // } // })); //} /// <summary> /// 上下滑动窗体 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void InitImgpanel() { try { for (int i = 0; i < 7; i++) { PhotoFrame pf = new PhotoFrame(coupons.CouponsList[i + 1][0]); if (coupons.CouponsList[i + 1][0].Num != "") { pf.MouseLeftButtonUp += new MouseButtonEventHandler(imageMouseLeftButtonUp); } pf.Name = "imagePF" + i; imgPanel1.Children.Add(pf); } PhotoFrame_Eight pf8 = new PhotoFrame_Eight(coupons.CouponsList[8][0]); pf8.Name = "imagePF8"; imgPanel2.Children.Add(pf8); } catch (Exception ex) { throw ex; } }
private void Exit_Click(object sender, RoutedEventArgs e) { PhotoFrame.Navigate(typeof(MainPage)); }
void LoadProjectFile() { FileStream fs; try { fs = new FileStream(filename, FileMode.Open); } catch (FileNotFoundException) { MessageBox.Show("The file not found. Sorry."); return; } catch (Exception) { MessageBox.Show("Can't open file"); return; } XmlTextReader xmlIn = new XmlTextReader(fs); xmlIn.WhitespaceHandling = WhitespaceHandling.None; xmlIn.MoveToContent(); if (xmlIn.Name != "PhotoWorkshopProject") { throw new ArgumentException("Incorrect file format."); } string version = xmlIn.GetAttribute(0); int xIndex = 1; do { if (!xmlIn.Read()) { throw new ArgumentException("An element was expected but could not be read in"); } if ((xmlIn.NodeType == XmlNodeType.EndElement) && (xmlIn.Name == "PhotoWorkshopProject")) { break; } if (xmlIn.NodeType == XmlNodeType.EndElement) { continue; } if (xmlIn.Name == "PhotoPicture") { LoadPictureFromFile(xmlIn); continue; } if (xmlIn.Name == "DesignerItem") { DesignerBaseItem item = DesignerBaseItem.CreateDesignerItemByID(Convert.ToInt32(xmlIn.GetAttribute("Kind"))); imageCanvas.Children.Add(item); item.LoadFromFile(xmlIn); Canvas.SetZIndex(item, xIndex); } if (xmlIn.Name == "BaseFrame") { BasePhotoFrame frame = BasePhotoFrame.CreatePhotoFrameByID(Convert.ToInt32(xmlIn.GetAttribute("Kind"))); frame.LoadFromFile(xmlIn); PhotoFrame = frame; } if (xmlIn.Name == "ProjectProperties") { LoadProjectPropertiesFromFile(xmlIn); } xIndex++; } while (!xmlIn.EOF); xmlIn.Close(); fs.Close(); if (PhotoFrame != null) { PhotoFrame.Visualize(ImageCanvas, imageControl.Width, imageControl.Height); } }