本文整理汇总了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);
}
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例6: InAirPackets
public void InAirPackets(RealTimeStylus sender, InAirPacketsData data)
{
}
示例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);
}
示例8: CustomStylusDataAdded
public void CustomStylusDataAdded(RealTimeStylus sender, CustomStylusData data)
{
}
示例9:
void IStylusSyncPlugin.StylusOutOfRange(RealTimeStylus sender, StylusOutOfRangeData data)
{
}
示例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;
}
}
示例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);
}
示例12: StylusButtonDown
public void StylusButtonDown(RealTimeStylus sender, StylusButtonDownData data)
{
}
示例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
}
示例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)
{
}
示例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
}