• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# RealTimeStylus类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: HandlePackets

        /// <summary>
        /// Erases strokes that overlap the cursor.
        /// </summary>
        /// <param name="sender">The real time stylus associated with the notification</param>
        /// <param name="data">The notification data</param>
        /// <seealso cref="EraserPlugin.StylusDown"/>
        /// <seealso cref="EraserPlugin.Packets"/>
        /// <seealso cref="EraserPlugin.StylusUp"/>
        private void HandlePackets(RealTimeStylus sender, StylusDataBase data)
        {
            using (Synchronizer.Lock(this)) {
                // Ignore the strokes if the eraser stylus is not selected,
                // and if the stylus is not inverted.
                if (this.Eraser == null && !data.Stylus.Inverted)
                    return;

                // Ignore if a touch input
                if (m_TouchSupported) {
                    try {
                        if (sender.GetTabletFromTabletContextId(data.Stylus.TabletContextId).DeviceKind == TabletDeviceKind.Touch)
                            return;
                    }
                    catch {
                        m_TouchSupported = false;
                    }
                }

                // Ignore the strokes if no ink sheet is selected.
                InkSheetModel sheet = this.InkSheetModel;
                if (sheet == null)
                    return;

                // Convert the X and Y coordinates of the data,
                // which are defined to be at offsets [i] and [i+1],
                // to an array of Points.
                Debug.Assert(data.Count % data.PacketPropertyCount == 0);
                Point[] points = new Point[data.Count / data.PacketPropertyCount];
                for (int i = 0, j = 0, il = data.Count, inc = data.PacketPropertyCount; i < il; i += inc, j++)
                    points[j] = new Point(data[i], data[i + 1]);

                // Convert the ink points to pixels so we can
                // ignore the ones that are outside the slide view area.
                // This is done all at once to conserve resources used by the Graphics object.
                Point[] pixels = points;
                using (Synchronizer.Lock(this.m_Display.SyncRoot))
                    using (Graphics g = this.m_Display.CreateGraphics())
                        this.m_Renderer.InkSpaceToPixel(g, ref pixels);

                // Prevent anyone else from accessing the ink concurrently.
                using (Synchronizer.Lock(this.InkSheetModel.Ink.Strokes.SyncRoot)) {
                    // Iterate through each point through which the cursor has passed.
                    for(int i = 0, il = points.Length; i < il; i++) {
                        // Don't erase anything when the cursor is outside of the
                        // slide viewing area.  This prevents users from accidentally
                        // erasing strokes they can't see, especially when using the
                        // slide zoom feature.
                        if (!this.m_DisplayBounds.Contains(pixels[i]))
                            continue;

                        // Find all strokes within some radius from the cursor.
                        Strokes erased = sheet.Ink.HitTest(points[i], ERASER_RADIUS);

                        // If any strokes were found, erase them.
                        if (erased.Count > 0) {
                            // Get the list of stroke IDs in order to send an event
                            int[] ids = new int[erased.Count];
                            for (int j = 0; j < ids.Length; j++)
                                ids[j] = erased[j].Id;

                            // We must first warn listeners that the strokes are about to
                            // be deleted, because after they're deleted, no information
                            // about them can be recovered.  This is used to send
                            // network events and to store undo information.
                            sheet.OnInkDeleting(new StrokesEventArgs(ids));

                            // Delete the erased strokes.
                            sheet.Ink.DeleteStrokes(erased);

                            // Inform listeners that the strokes have actually been deleted.
                            // This causes slide displays to refresh.
                            sheet.OnInkDeleted(new StrokesEventArgs(ids));
                        }
                    }
                }
            }
        }
开发者ID:ClassroomPresenter,项目名称:CP3,代码行数:86,代码来源:EraserPlugin.cs


示例17: Packets

 /// <summary>
 /// Occurs when the stylus moves on the digitizer surface.
 /// Add new packet data into the packet array 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 Packets(RealTimeStylus sender, PacketsData data)
 {
     // Use the stylus id as a key to retrieve the packet array for the
     // stylus.  Insert the new packet data into this array.
     ((ArrayList)(myPackets[data.Stylus.Id])).AddRange(data.GetData());
 }
开发者ID:dgrapp1,项目名称:WindowsSDK7-Samples,代码行数:12,代码来源:InkCollection.cs


示例18: RealTimeStylusEnabled

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


示例19: Error

 public void Error(RealTimeStylus sender, ErrorData data) { }
开发者ID:dgrapp1,项目名称:WindowsSDK7-Samples,代码行数:1,代码来源:MTScratchpadRTStylus.cs


示例20: StylusButtonUp

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Realm类代码示例发布时间:2022-05-24
下一篇:
C# RealFeatures类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap