当前位置: 首页>>代码示例>>C#>>正文


C# RealTimeStylus类代码示例

本文整理汇总了C#中RealTimeStylus的典型用法代码示例。如果您正苦于以下问题:C# RealTimeStylus类的具体用法?C# RealTimeStylus怎么用?C# RealTimeStylus使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RealTimeStylus类属于命名空间,在下文中一共展示了RealTimeStylus类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: StylusInputSelector

        public StylusInputSelector(PresenterModel model, RealTimeStylus rts)
        {
            this.m_Model = model;
            this.m_RealTimeStylus = rts;

            this.m_Model.Changed["Stylus"].Add(new PropertyEventHandler(this.HandleStylusChanged));

            using(Synchronizer.Lock(this.m_Model)) {
                this.HandleStylusChanged(this.m_Model, null);
            }
        }
开发者ID:ClassroomPresenter,项目名称:CP3,代码行数:11,代码来源:StylusInputSelector.cs

示例2: StylusMouseMux

 public StylusMouseMux( Form form )
 {
     using ( var fx = form.CreateGraphics() ) {
         FormDpiX = fx.DpiX;
         FormDpiY = fx.DpiY;
     }
     form.MouseDown += OnMouseDown;
     form.MouseMove += OnMouseMove;
     form.MouseUp   += OnMouseUp;
     RTS = new RealTimeStylus(form,true);
     RTS.AsyncPluginCollection.Add(this);
     Form = form;
 }
开发者ID:MaulingMonkey,项目名称:SketchBook,代码行数:13,代码来源:StylusMouseMux.cs

示例3: OnLoadHandler

        // OnLoad window event handler
        // in:
        //      sender      object that has sent the event
        //      e           event arguments
        private void OnLoadHandler(Object sender, EventArgs e)
        {
            // Create RealTimeStylus object and enable it for multi-touch
            realTimeStylus = new RealTimeStylus(this);
            realTimeStylus.MultiTouchEnabled = true;

            // Create DynamicRenderer and event handler, and add them to the RTS object as synchronous plugins
            dynamicRenderer = new DynamicRenderer(this);
            eventHandler = new EventHandlerPlugIn(this.CreateGraphics(), dynamicRenderer);
            realTimeStylus.SyncPluginCollection.Add(eventHandler);
            realTimeStylus.SyncPluginCollection.Add(dynamicRenderer);

            // Enable RTS and DynamicRenderer object, and enable auto-redraw of the DynamicRenderer
            realTimeStylus.Enabled = true;
            dynamicRenderer.Enabled = true;
            dynamicRenderer.EnableDataCache = true;
        }
开发者ID:dgrapp1,项目名称:WindowsSDK7-Samples,代码行数:21,代码来源:MTScratchpadRTStylus.cs

示例4: Initialize

 // Token: 0x06002FC2 RID: 12226
 // RVA: 0x00134624 File Offset: 0x00132824
 internal override bool Initialize()
 {
     try
     {
         if (!this.bool_0)
         {
             this.realTimeStylus_0 = new RealTimeStylus(Class115.class115_0.method_4().vmethod_1(), false);
             Class801 item = new Class801(this);
             this.realTimeStylus_0.AsyncPluginCollection.Add(item);
             this.realTimeStylus_0.Enabled = Class341.class606_62.Value;
             this.bool_0 = true;
             return true;
         }
     }
     catch (Exception)
     {
         Class723.smethod_4("Tablet initialisation failed.");
     }
     return false;
 }
开发者ID:newchild,项目名称:Project-DayZero,代码行数:22,代码来源:Class571.cs

示例5: HookStylus

        public static void HookStylus(IStylusReaderHooks subject, Control control)
        {
            if (hookedControls.Contains(control))
            {
                throw new ApplicationException("control is already hooked");
            }

            RealTimeStylus stylus = new RealTimeStylus(control, true);
            PaintDotNet.StylusAsyncPlugin stylusReader = new PaintDotNet.StylusAsyncPlugin(subject, control);
            
            stylus.AsyncPluginCollection.Add(stylusReader);
            stylus.SetDesiredPacketDescription(new Guid[] { PacketProperty.X, 
                                                            PacketProperty.Y, 
                                                            PacketProperty.NormalPressure, 
                                                            PacketProperty.PacketStatus});
            stylus.Enabled = true;

            control.Disposed += new EventHandler(control_Disposed);

            WeakReference weakRef = new WeakReference(control);
            hookedControls.Add(weakRef, stylus);
        }
开发者ID:herbqiao,项目名称:paint.net,代码行数:22,代码来源:StylusReader.cs

示例6: InAirPackets

 public void InAirPackets(RealTimeStylus sender, InAirPacketsData data)
 {
 }
开发者ID:dgrapp1,项目名称:WindowsSDK7-Samples,代码行数:3,代码来源:InkCollection.cs

示例7: Error

 /// <summary>
 /// Called when the current plugin or the ones previous in the list
 /// threw an exception.
 /// </summary>
 /// <param name="sender">The real time stylus</param>
 /// <param name="data">Error data</param>
 public void Error(RealTimeStylus sender, ErrorData data)
 {
     Debug.Assert(false, null, "An error occurred.  DataId=" + data.DataId + ", " + "Exception=" + data.InnerException);
 }
开发者ID:dgrapp1,项目名称:WindowsSDK7-Samples,代码行数:10,代码来源:InkCollection.cs

示例8: CustomStylusDataAdded

 public void CustomStylusDataAdded(RealTimeStylus sender, CustomStylusData data)
 {
 }
开发者ID:dgrapp1,项目名称:WindowsSDK7-Samples,代码行数:3,代码来源:InkCollection.cs

示例9:

 void IStylusSyncPlugin.StylusOutOfRange(RealTimeStylus sender, StylusOutOfRangeData data)
 {
 }
开发者ID:ClassroomPresenter,项目名称:CP3,代码行数:3,代码来源:EraserPlugin.cs

示例10: StylusUp

        /// <summary>
        /// Occurs when the stylus leaves the digitizer surface.
        /// Retrieve the packet array for this stylus and use it to create
        /// a new stoke.
        /// </summary>
        /// <param name="sender">The real time stylus associated with the notification</param>
        /// <param name="data">The notification data</param>
        public void StylusUp(RealTimeStylus sender, StylusUpData data)
        {
            // Retrieve the packet array from the hashtable using the cursor id
            // as a key.  Then, clean this entry from the hash since it is no
            // longer needed.
            ArrayList collectedPackets = (ArrayList)myPackets[data.Stylus.Id];
            myPackets.Remove(data.Stylus.Id);

            // Add the packet data from StylusUp to the array
            collectedPackets.AddRange(data.GetData());

            // Create the stroke using the specified drawing attributes.
            int[] packets = (int[])(collectedPackets.ToArray(typeof(int)));
            TabletPropertyDescriptionCollection tabletProperties = myRealTimeStylus.GetTabletPropertyDescriptionCollection(data.Stylus.TabletContextId);

            Stroke stroke = myInk.CreateStroke(packets, tabletProperties);
            if (stroke != null)
            {
                stroke.DrawingAttributes.Color = myDynamicRenderer.DrawingAttributes.Color;
                stroke.DrawingAttributes.Width = myDynamicRenderer.DrawingAttributes.Width;
            }
        }
开发者ID:dgrapp1,项目名称:WindowsSDK7-Samples,代码行数:29,代码来源:InkCollection.cs

示例11: StylusDown

        /// <summary>
        /// Occurs when the stylus touches the digitizer surface.
        /// Allocate a new array to store the packet data for this stylus.
        /// </summary>
        /// <param name="sender">The real time stylus associated with the notification</param>
        /// <param name="data">The notification data</param>
        public void StylusDown(RealTimeStylus sender, StylusDownData data)
        {
            // Allocate an empty array to store the packet data that will be
            // collected for this stylus.
            ArrayList collectedPackets = new ArrayList();

            // Add the packet data from StylusDown to the array
            collectedPackets.AddRange(data.GetData());

            // Insert the array into a hashtable using the stylus id as a key.
            myPackets.Add(data.Stylus.Id, collectedPackets);
        }
开发者ID:dgrapp1,项目名称:WindowsSDK7-Samples,代码行数:18,代码来源:InkCollection.cs

示例12: StylusButtonDown

 public void StylusButtonDown(RealTimeStylus sender, StylusButtonDownData data)
 {
 }
开发者ID:dgrapp1,项目名称:WindowsSDK7-Samples,代码行数:3,代码来源:InkCollection.cs

示例13: StylusUp

 // Pen-up notification handler.
 // Decrements finger-down counter.
 //      sender      RTS event sender object
 //      data        event arguments
 public void StylusUp(RealTimeStylus sender, StylusUpData data)
 {
     --cntContacts;  // Decrement finger-down counter
 }
开发者ID:dgrapp1,项目名称:WindowsSDK7-Samples,代码行数:8,代码来源:MTScratchpadRTStylus.cs

示例14: Packets

 // Pen-move notification handler
 // In this case, does nothing, but likely to be used in a more complex application.
 // RTS framework does stroke collection and rendering for us.
 //      sender      RTS event sender object
 //      data        event arguments
 public void Packets(RealTimeStylus sender, PacketsData data)
 {
 }
开发者ID:dgrapp1,项目名称:WindowsSDK7-Samples,代码行数:8,代码来源:MTScratchpadRTStylus.cs

示例15: StylusDown

        // Pen-down notification handler.
        // Sets the color for the newly started stroke and increments finger-down counter.
        //      sender      RTS event sender object
        //      data        event arguments
        public void StylusDown(RealTimeStylus sender, StylusDownData data)
        {
            // Set new stroke color to the DrawingAttributes of the DynamicRenderer
            // If there are no fingers down, this is a primary contact
            dynamicRenderer.DrawingAttributes.Color = touchColor.GetColor(cntContacts == 0);

            ++cntContacts;  // Increment finger-down counter
        }
开发者ID:dgrapp1,项目名称:WindowsSDK7-Samples,代码行数:12,代码来源:MTScratchpadRTStylus.cs


注:本文中的RealTimeStylus类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。