English 中文(简体)
如何检查3名护卫被放在屏幕上
原标题:How to check if 3 fingers are placed on the screen

就我的申请而言,我要利用一切建筑在操纵可能性中,例如索姆。 但是,如果用户在屏幕上播放3个点动器,那么我就想显示一个具体的核心要素。 因此,检查用户是否同时和在屏幕上相互接通3台手套的最佳方式是什么? (不排除所建的操纵材料)。

我的第一项做法是,就我的布局中最高级的Gridd要素登记国际通商活动。 如果是手稿,我就联系了。 但这怎么办?

如果接触是print,将其储存在清单中,如果清单中已经包含两种类似内容,则进行公正的检查?

还是存在更多的性解决办法?

感谢!

Edit:

在答复一之后,我写了两种方法:

private void OnContactDown(object sender, ContactEventArgs e)
        {
            if (this.ContactsOver.Count == 3)
            {
                Console.WriteLine("3 contacts down. Check proximity");

                if (areNear(this.ContactsOver))
                {
                    Console.WriteLine("3 fingers down!");
                }
            }
        }

        private Boolean areNear(ReadOnlyContactCollection contacts)
        {
            if ( Math.Abs(contacts.ElementAt(0).GetCenterPosition(this).X - contacts.ElementAt(1).GetCenterPosition(this).X) < 100 &&
                 Math.Abs(contacts.ElementAt(0).GetCenterPosition(this).Y - contacts.ElementAt(1).GetCenterPosition(this).Y) < 100 &&
                 Math.Abs(contacts.ElementAt(1).GetCenterPosition(this).X - contacts.ElementAt(2).GetCenterPosition(this).X) < 100 &&
                 Math.Abs(contacts.ElementAt(1).GetCenterPosition(this).Y - contacts.ElementAt(2).GetCenterPosition(this).Y) < 100 &&
                 Math.Abs(contacts.ElementAt(0).GetCenterPosition(this).X - contacts.ElementAt(2).GetCenterPosition(this).X) < 100 &&
                 Math.Abs(contacts.ElementAt(0).GetCenterPosition(this).Y - contacts.ElementAt(2).GetCenterPosition(this).Y) < 100)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

他们必须改写,但行得通。 必须调整门槛值(100)。

最佳回答

There is a property on all surface controls that contains the number of contacts över it. The propery is ContactsOver or any variant of it depending on your need, see http://msdn.microsoft.com/en-us/library/microsoft.surface.presentation.controls.surfacecontrol_properties(v=Surface.10).aspx

比如,你可以检查一下,你在接触会场活动中,有适当的数字价值。 为了检查其距离,就在他们身上打上“知识”,并在这些地方使用基本的病媒数学。

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签