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


C# RealTimeStylus.GetTabletPropertyDescriptionCollection方法代码示例

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


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

示例1:

        // Copied from the RealTimeStylus InkCollection example from
        // the Microsoft Tablet PC API Sample Applications collection.
        /// <summary>
        /// Occurs when the stylus touches the digitizer surface.
        /// </summary>
        /// <param name="sender">The real time stylus associated with the notification</param>
        /// <param name="data">The notification data</param>
        void IStylusSyncPlugin.StylusDown(RealTimeStylus sender, StylusDownData data)
        {
            // An inverted stylus is reserved for the eraser.
            if(data.Stylus.Inverted) return;

            this.m_Core.StylusDown(data.Stylus.Id, 0, data.GetData(),
                sender.GetTabletPropertyDescriptionCollection(data.Stylus.TabletContextId));
        }
开发者ID:kevinbrink,项目名称:CP3_Enhancement,代码行数:15,代码来源:TransformableDynamicRenderer.cs

示例2: using

        /// <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>
        void IStylusAsyncPlugin.StylusUp(RealTimeStylus sender, StylusUpData data)
        {
            // Retrieve the packet array from the hashtable using the cursor id as a key.
            int stylusId = data.Stylus.Id;
            List<int> collected;
            if (!this.m_PacketsTable.TryGetValue(stylusId, out collected)) {
                // If ink collection was disabled on StylusDown or if the user is erasing,
                // then ignore these packets.
                return;
            }

            int strokeId = this.m_StrokeIdTable[stylusId];

            // Also get the DrawingAttributes which were in effect on StylusDown.
            DrawingAttributes atts = this.m_DrawingAttributesTable[stylusId];

            // Remove this entry from the hash tables since it is no longer needed.
            this.m_PacketsTable.Remove(stylusId);
            this.m_DrawingAttributesTable.Remove(stylusId);

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

            // Assemble the completed information we'll need to create the stroke.
            int[] packets = collected.ToArray();
            TabletPropertyDescriptionCollection tabletProperties =
                sender.GetTabletPropertyDescriptionCollection(data.Stylus.TabletContextId);

            // Now that we have the data, we're ready to create the stroke and add it to our Ink object.
            using(Synchronizer.Lock(this)) { // Ensure that this.(RealTime)InkSheetModel aren't changed unexpectedly.
                // If there is no Ink object, then probably the SlideViewer is not looking at a slide,
                // so discard the stroke.  Otherwise, create the stroke from the collected packets.
                // Also discard the stroke if we have no DrawingAttributes.

                if(this.InkSheetModel != null && atts != null) {
                    int inkStrokeId;
                    using (Synchronizer.Lock(this.InkSheetModel.Ink.Strokes.SyncRoot)) {
                        Stroke stroke = this.InkSheetModel.Ink.CreateStroke(packets, tabletProperties);
                        stroke.DrawingAttributes = atts.Clone();
                        inkStrokeId = stroke.Id;
                    }
                    // Note that this ink stroke's Id is different from the strokeId used by the RealTimeInkSheetModel.
                    this.InkSheetModel.OnInkAdded(new StrokesEventArgs(new int[] { inkStrokeId }));
                }

                if(this.RealTimeInkSheetModel != null) {
                    this.RealTimeInkSheetModel.OnStylusUp(stylusId, strokeId, data.GetData());
                }
            }
        }
开发者ID:kevinbrink,项目名称:CP3_Enhancement,代码行数:57,代码来源:InkAnnotationCollector.cs

示例3:

        // Copied from the RealTimeStylus InkCollection example from
        // the Microsoft Tablet PC API Sample Applications collection.
        /// <summary>
        /// Occurs when the stylus touches the digitizer surface.
        /// </summary>
        /// <param name="sender">The real time stylus associated with the notification</param>
        /// <param name="data">The notification data</param>
        void IStylusSyncPlugin.StylusDown(RealTimeStylus sender, StylusDownData data)
        {
            // An inverted stylus is reserved for the eraser.
            if(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;
                }
            }

            this.m_Core.StylusDown(data.Stylus.Id, 0, data.GetData(),
                sender.GetTabletPropertyDescriptionCollection(data.Stylus.TabletContextId));
        }
开发者ID:ClassroomPresenter,项目名称:CP3,代码行数:25,代码来源:TransformableDynamicRenderer.cs

示例4:

        /// <summary>
        /// Occurs when the stylus touches the digitizer surface.
        /// </summary>
        /// <param name="sender">The real time stylus associated with the notification</param>
        /// <param name="data">The notification data</param>
        void IStylusSyncPlugin.StylusDown(RealTimeStylus sender, StylusDownData data)
        {
            //Debug.WriteLine("StylusDown");
            Tablet currentTablet = sender.GetTabletFromTabletContextId(data.Stylus.TabletContextId);
            if (currentTablet.DeviceKind == TabletDeviceKind.Touch) {
                // The stylus id
                int stylusId = data.Stylus.Id;

                // Store the packets in the collected packets
                List<int> collected = new List<int>(data.GetData());
                this.collectedPacketsTable[stylusId] = collected;

                // Store the tablet properties
                this.tabletPropertiesTable[stylusId] = sender.GetTabletPropertyDescriptionCollection(data.Stylus.TabletContextId);
            }
        }
开发者ID:ClassroomPresenter,项目名称:CP3,代码行数:21,代码来源:TouchGestureHandler.cs


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