/// <remarks>Check enabled status before altering properties that require source to be /// disabled.</remarks> public void UnsetData(Ink.InkCollector inkSource) { if (this.myInkSources.Contains(inkSource)) { this.myInkSources.Remove(inkSource); inkSource.NewPackets -= new Ink.InkCollectorNewPacketsEventHandler(this.HandleNewPackets); } }
/// <remarks>Check enabled status before altering properties that require source to be /// disabled.</remarks> public void SetData(Ink.InkCollector inkSource) { if (!this.myInkSources.Contains(inkSource)) { if (!inkSource.Enabled) { inkSource.Ink = myInk; } inkSource.NewPackets += new Ink.InkCollectorNewPacketsEventHandler(this.HandleNewPackets); this.myInkSources.Add(inkSource); } }
private void FormAnnotationOld_Load(object sender, EventArgs e) { //inkCollector = new Microsoft.Ink.InkCollector(this.Handle);改动过 inkCollector = new Microsoft.Ink.InkCollector(this.pictureBox); inkCollector.Enabled = true; inkCollector.CollectionMode = Microsoft.Ink.CollectionMode.InkAndGesture; inkCollector.Gesture += new Microsoft.Ink.InkCollectorGestureEventHandler(inkCollector_Gesture); inkCollector.Stroke += new Microsoft.Ink.InkCollectorStrokeEventHandler(inkCollector_Stroke); inkCollector.SetGestureStatus(Microsoft.Ink.ApplicationGesture.AllGestures, true); if (videoFilePath != string.Empty) { reader.Open(this.videoFilePath); DrawFrames(); } }
/// <summary> /// Main form loads - sets up UI for drawing and starts connection wizard /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MainForm_Load(object sender, System.EventArgs e) { int iPenWidth = 1; // obtain and show version version = Application.ProductVersion; version = version.Substring(0,version.LastIndexOf(".")); version = version.Substring(0,version.LastIndexOf(".")); this.Text = "InkTalk " + version; try { // read configuration file variables connectionPort = Convert.ToInt32(ConfigurationSettings.AppSettings["Port"]); connectionIPAddress = ConfigurationSettings.AppSettings["IP"]; iPenWidth = Convert.ToInt32(ConfigurationSettings.AppSettings["PenWidth"]); } catch (Exception ex) { MessageBox.Show(this,"Missing or invalid configuration file: " + Environment.NewLine + ex.Message,"InkTalk " + version, MessageBoxButtons.OK, MessageBoxIcon.Error); Application.Exit(); } // create start up form startupForm = new StartupForm(version, connectionIPAddress); // set delegate addInkMessageDelegate = new AddInkMessageDelegate(addInkMessage); setMainFormVisibilityDelegate = new SetMainFormVisibilityDelegate(setMainFormVisibility); setStatusBarTextDelegate = new SetStatusBarTextDelegate(setStatusBarText); setSendButtonStateDelegate = new SetSendButtonStateDelegate(setSendButtonState); // set up input ink collector inputInkCollector = new InkCollector(inputBox.Handle); inputInkCollector.DefaultDrawingAttributes.Width = iPenWidth; inputInkCollector.Enabled = true; // set up chat ink output chatInkOverlay = new InkOverlay(chatPanel.Handle); chatInkOverlay.Renderer.GetViewTransform(ref unmodifiedMatrix); chatInkOverlay.EditingMode = InkOverlayEditingMode.Select; chatInkOverlay.Enabled = true; // start connection wizard newConnectionWizard(); }