要一个现在能用的qq2d桌球瞄准器2012,百发百中那种。一定要无毒,能用。

要一个现在能用的QQ2D桌球瞄准器,一定要无毒,能用_百度知道
要一个现在能用的QQ2D桌球瞄准器,一定要无毒,能用
我有更好的答案
记得查收!
其他类似问题
为您推荐:
您可能关注的推广
瞄准器的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁能用的QQ2D桌球瞄准器,要简单好用,最好直接用右键就能瞄准的那种 QQ一五七二四六二四五五 谢谢_百度知道
能用的QQ2D桌球瞄准器,要简单好用,最好直接用右键就能瞄准的那种 QQ一五七二四六二四五五 谢谢
提问者采纳
加你为好友了
提问者评价
其他类似问题
为您推荐:
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁QQ桌球瞄准器2015 0722
相关合集:
相关热搜:
即时战略游戏,玩单机游戏的大家一定都不会很陌生,在竞技界耳熟能详的几款游戏中,即时战略游戏就占了好几款。
高速下载地址
联通下载地址
电信下载地址
移动下载地址
其他下载地址
(您的评论需要经过审核才能显示)谁有免费的QQ游戏 qq2d桌球瞄准器,最好是不用带路线的,右键瞄准左键发射的那种,能用的无毒的哦._百度知道
谁有免费的QQ游戏 qq2d桌球瞄准器,最好是不用带路线的,右键瞄准左键发射的那种,能用的无毒的哦.
QQ游戏 2d桌球
提问者采纳
免费的是没有的。
提问者评价
其他类似问题
为您推荐:
您可能关注的推广
qq游戏的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁用C#调用Matlab图像处理自制QQ游戏2D桌球瞄准器_ASP.NET技巧_
用C#调用Matlab图像处理自制QQ游戏2D桌球瞄准器
来源:人气:623
平时不怎么玩,有时消遣就玩玩里的2D桌球,但是玩的次数少,不能像骨灰级玩家一样百发百中,肿么办呢?于是某天突发奇想,决定自己也来做个&外挂&。说是外挂,其实只是一个瞄准器,毕竟外挂是修改别人的软件,有点违法的意思,况且自己还没有能力去那么做,所以自己还是弄个瞄准器,做做弊,过下小瘾,同时也提高一下自己的编程能力。
起初(也就是半年前),自己尝试做一个瞄准器的初始版本,用C#做,想法很简单:
Step1.把鼠标移到洞口,获取鼠标位置;
Step2.将鼠标放到要击打的球的圆心上,获取鼠标当前位置
Step3.根据进球时三点共线的原则按照球的半径自动将鼠标移动到准确的击球点。
示意图如下:
于是当初就按照这个想法做了,开始给自己做了个C#版,调用Windows API中的GetDesktopWindow,GetWindowDC,SetCursorPos三个函数,经过简单的数学运算,就基本实现了功能。代码如下:
Csharp代码&
using&System.D&&
using&System.Windows.F&&
using&System.W&&
using&System.Runtime.InteropS&&
namespace&TaiqiuGua&&
&&&&public&partial&class&Form1&:&Form&&
&&&&&&&&const&int&ra=25;&&
&&&&&&&&[DllImport("user32.dll")]&&
&&&&&&&&static&extern&IntPtr&GetDesktopWindow();&&
&&&&&&&&[DllImport("user32.dll")]&&
&&&&&&&&static&extern&IntPtr&GetWindowDC(IntPtr&hWnd);&&
&&&&&&&&[DllImport("user32.dll")]&&
&&&&&&&&static&extern&bool&SetCursorPos(int&X,&int&Y);&&
&&&&&&&&public&Form1()&&
&&&&&&&&{&&
&&&&&&&&&&&&InitializeComponent();&&
&&&&&&&&}&&
&&&&&&&&Point&startP;&&
&&&&&&&&Point&endP;&&
&&&&&&&&&&
&&&&&&&&ivate&void&Form1_KeyDown(object&sender,&KeyEventArgs&e)&&
&&&&&&&&{&&
&&&&&&&&&&&&switch(e.KeyData)&&
&&&&&&&&&&&&{&&
&&&&&&&&&&&&&&&&case&Keys.F1:&&
&&&&&&&&&&&&&&&&&&&&startP=Control.MouseP&&
&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&case&Keys.F2:&&
&&&&&&&&&&&&&&&&&&&&endP&=&Control.MouseP&&
&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&case&Keys.D1:&&
&&&&&&&&&&&&&&&&&&&&int&x1&=&(int)(endP.X&+&ra&*&((endP.X&-&startP.X)&/&Math.Sqrt((endP.X&-&startP.X)&*&(endP.X&-&startP.X)&+&(endP.Y&-&startP.Y)&*&(endP.Y&-&startP.Y))));&&
&&&&&&&&&&&&&&&&&&&&int&y1&=&(int)(endP.Y&+&ra&*&((endP.Y&-&startP.Y)&/&Math.Sqrt((endP.X&-&startP.X)&*&(endP.X&-&startP.X)&+&(endP.Y&-&startP.Y)&*&(endP.Y&-&startP.Y))));&&
&&&&&&&&&&&&&&&&&&&&SetCursorPos(x1,&y1);&&
&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&case&Keys.D2:&&
&&&&&&&&&&&&&&&&&&&&int&x2&=&(int)(endP.X&-&ra&*&((-endP.X&+&startP.X)&/&Math.Sqrt((-endP.X&+&startP.X)&*&(-endP.X&+&startP.X)&+&(endP.Y&-&startP.Y)&*&(endP.Y&-&startP.Y))));&&
&&&&&&&&&&&&&&&&&&&&int&y2&=&(int)(endP.Y&+&ra&*&((endP.Y&-&startP.Y)&/&Math.Sqrt((-endP.X&+&startP.X)&*&(-endP.X&+&startP.X)&+&(endP.Y&-&startP.Y)&*&(endP.Y&-&startP.Y))));&&
&&&&&&&&&&&&&&&&&&&&SetCursorPos(x2,&y2);&&
&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&case&Keys.D3:&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&int&x3&=&(int)(endP.X&+&ra&*&((endP.X&-&startP.X)&/&Math.Sqrt((endP.X&-&startP.X)&*&(endP.X&-&startP.X)&+&(-endP.Y&+&startP.Y)&*&(-endP.Y&+&startP.Y))));&&
&&&&&&&&&&&&&&&&&&&&int&y3&=&(int)(endP.Y&-&ra&*&((-endP.Y&+&startP.Y)&/&Math.Sqrt((endP.X&-&startP.X)&*&(endP.X&-&startP.X)&+&(-endP.Y&+&startP.Y)&*&(-endP.Y&+&startP.Y))));&&
&&&&&&&&&&&&&&&&&&&&SetCursorPos(x3,&y3);&&
&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&case&Keys.D4:&&
&&&&&&&&&&&&&&&&&&&&int&x4&=&(int)(endP.X&-&ra&*&((-endP.X&+&startP.X)&/&Math.Sqrt((-endP.X&+&startP.X)&*&(-endP.X&+&startP.X)&+&(-endP.Y&+&startP.Y)&*&(-endP.Y&+&startP.Y))));&&
&&&&&&&&&&&&&&&&&&&&int&y4&=&(int)(endP.Y&-&ra&*&((-endP.Y&+&startP.Y)&/&Math.Sqrt((-endP.X&+&startP.X)&*&(-endP.X&+&startP.X)&+&(-endP.Y&+&startP.Y)&*&(-endP.Y&+&startP.Y))));&&
&&&&&&&&&&&&&&&&&&&&SetCursorPos(x4,&y4);&&
&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&}&&
&&&&&&&&&&&&GC.Collect();&&
&&&&&&&&}&&
使用时,只需要激活瞄准器窗口,按F1,F2获取鼠标位置,再根据洞口位置分别选按1、2、3、4数字键就行。
经过N次试验,成功率还挺高,只是有时候手动放置鼠标到被击打球圆心会出现误差,导致击球不准,当然,后来我赢了很多场比赛(嘿嘿,有点不道德!)。
再后来,又用C写了一遍,给同学用了。代码如下:
#include&&windows.h&&&
#include&&math.h&&&
int&ra=26;&&
int&flag=0;&&
POINT&startP,endP;&&
int&x5,y5,x2,y2,x3,y3,x4,y4;&&
LRESULT&CALLBACK&WndProc&(HWND,&UINT,&WPARAM,&LPARAM)&;&&
int&WINAPI&WinMain&(HINSTANCE&hInstance,&HINSTANCE&hPrevInstance,PSTR&szCmdLine,&int&iCmdShow)&&
&&&&static&TCHAR&szAppName[]&=&TEXT&("GUA")&;&&
&&&&HWND&hwnd&;&&
&&&&MSG&msg&;&&
&&&&WNDCLASS&wndclass&;&&
&&&&wndclass.style&=&CS_HREDRAW&|&CS_VREDRAW&;&&
&&&&wndclass.lpfnWndProc&=&WndProc&;&&
&&&&wndclass.cbClsExtra&=&0&;&&
&&&&wndclass.cbWndExtra&=&0&;&&
&&&&wndclass.hInstance&=&hInstance&;&&
&&&&wndclass.hIcon&=&LoadIcon&(NULL,&IDI_)&;&&
&&&&wndclass.hCursor&=&LoadCursor&(NULL,&IDC_ARROW)&;&&
&&&&wndclass.hbrBackground&=&(HBRUSH)&GetStockObject&(WHITE_BRUSH)&;&&
&&&&wndclass.lpszMenuName&=&NULL&;&&
&&&&wndclass.lpszClassName&=&szAppName&;&&
&&&&if&(!RegisterClass&(&wndclass))&&
&&&&&&&&MessageBox&(&NULL,&TEXT&("Program&requires&Windows&NT!"),&&
&&&&&&&&&&&&szAppName,&MB_ICONERROR)&;&&
&&&&&&&&return&0&;&&
&&&&&&&&hwnd&=&CreateWindow&(szAppName,&TEXT&("Programmed&By&DC"),&&
&&&&&&&&&&&&WS_OVERLAPPEDWINDOW,&&
&&&&&&&&&&&&CW_USEDEFAULT,&CW_USEDEFAULT,&&
&&&&&&&&&&&&CW_USEDEFAULT,&CW_USEDEFAULT,&&
&&&&&&&&&&&&NULL,&NULL,&hInstance,&NULL)&;&&
&&&&&&&&ShowWindow&(hwnd,&iCmdShow)&;&&
&&&&&&&&SetForegroundWindow(hwnd);&&
&&&&&&&&MoveWindow(hwnd,100,100,200,200,TRUE);&&
&&&&&&&&UpdateWindow&(hwnd)&;&&
&&&&&&&&while&(GetMessage&(&msg,&NULL,&0,&0))&&
&&&&&&&&{&&
&&&&&&&&&&&&TranslateMessage&(&msg)&;&&
&&&&&&&&&&&&DispatchMessage&(&msg)&;&&
&&&&&&&&}&&&&&&&&&
&&&&&&&&return&msg.wParam&;&&
void&Draw(HWND&hwnd,LPCSTR&lpString)&&
&&&&HDC&hdc&;&&&&
&&&&PAINTSTRUCT&ps&;&&&&
&&&&RECT&rect&;&&&
&&&&hdc&=&BeginPaint&(hwnd,&&ps)&;&&&&
&&&&GetClientRect&(hwnd,&&rect)&;&&&&
&&&&DrawText&(hdc,&lpString,&-1,&&rect,&&DT_SINGLELINE&|&DT_CENTER&|&DT_VCENTER)&;&&&&
&&&&EndPaint&(hwnd,&&ps)&;&&&
&&&&ReleaseDC(hwnd,hdc);&&
LRESULT&CALLBACK&WndProc&(HWND&hwnd,&UINT&message,&WPARAM&wParam,LPARAM&lParam)&&
&&&&HBRUSH&hBrush&;&&
&&&&HDC&hdc&;&&
&&&&PAINTSTRUCT&ps&;&&
&&&&RECT&rc&;&&
&&&&switch&(message)&&
&&&&&&&&case&WM_CREATE:&&
&&&&&&&&&&&&return&0&;&&
&&&&&&&&case&WM_PAINT&:&&
&&&&&&&&&&&&return&0&;&&
&&&&&&&&case&WM_KEYDOWN:&&&&
&&&&&&&&&&&&switch&(wParam)&&&&
&&&&&&&&&&&{&&&&
&&&&&&&&&&&&case&VK_F1:&&&&
&&&&&&&&&&&&&&&&&&&&GetCursorPos(&startP);&&
&&&&&&&&&&&&&&&&&&&&flag=1;&&
&&&&&&&&&&&&&&&&&&&&InvalidateRect&(hwnd,&NULL,&TRUE)&;&&
&&&&&&&&&&&&&&&&&&&&Draw(hwnd,"第1点已锁定!");&&
&&&&&&&&&&&&&&&&&&&&break&;&&&&
&&&&&&&&&&&&case&VK_F2:&&&&
&&&&&&&&&&&&&&&&&&&&GetCursorPos(&endP);&&
&&&&&&&&&&&&&&&&&&&&flag=2;&&
&&&&&&&&&&&&&&&&&&&&InvalidateRect&(hwnd,&NULL,&TRUE)&;&&
&&&&&&&&&&&&&&&&&&&&Draw(hwnd,"第2点已锁定!");&&
&&&&&&&&&&&&&&&&&&&&break&;&&&
&&&&&&&&&&&&case&0x31:&&&
&&&&&&&&&&&&&&&&&&&&x5&=&(int)(endP.x&+&ra&*&((endP.x&-&startP.x)&/&sqrt((endP.x&-&startP.x)&*&(endP.x&-&startP.x)&+&(endP.y&-&startP.y)&*&(endP.y&-&startP.y))));&&
&&&&&&&&&&&&&&&&&&&&y5&=&(int)(endP.y&+&ra&*&((endP.y&-&startP.y)&/&sqrt((endP.x&-&startP.x)&*&(endP.x&-&startP.x)&+&(endP.y&-&startP.y)&*&(endP.y&-&startP.y))));&&
&&&&&&&&&&&&&&&&&&&&SetCursorPos(x5,&y5);&&
&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&case&0x32:&&&
&&&&&&&&&&&&&&&&&&&&x2&=&(int)(endP.x&-&ra&*&((-endP.x&+&startP.x)&/&sqrt((-endP.x&+&startP.x)&*&(-endP.x&+&startP.x)&+&(endP.y&-&startP.y)&*&(endP.y&-&startP.y))));&&
&&&&&&&&&&&&&&&&&&&&y2&=&(int)(endP.y&+&ra&*&((endP.y&-&startP.y)&/&sqrt((-endP.x&+&startP.x)&*&(-endP.x&+&startP.x)&+&(endP.y&-&startP.y)&*&(endP.y&-&startP.y))));&&
&&&&&&&&&&&&&&&&&&&&SetCursorPos(x2,&y2);&&
&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&case&0x33:&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&x3&=&(int)(endP.x&+&ra&*&((endP.x&-&startP.x)&/&sqrt((endP.x&-&startP.x)&*&(endP.x&-&startP.x)&+&(-endP.y&+&startP.y)&*&(-endP.y&+&startP.y))));&&
&&&&&&&&&&&&&&&&&&&&y3&=&(int)(endP.y&-&ra&*&((-endP.y&+&startP.y)&/&sqrt((endP.x&-&startP.x)&*&(endP.x&-&startP.x)&+&(-endP.y&+&startP.y)&*&(-endP.y&+&startP.y))));&&
&&&&&&&&&&&&&&&&&&&&SetCursorPos(x3,&y3);&&
&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&case&0x34:&&
&&&&&&&&&&&&&&&&&&&&x4&=&(int)(endP.x&-&ra&*&((-endP.x&+&startP.x)&/&sqrt((-endP.x&+&startP.x)&*&(-endP.x&+&startP.x)&+&(-endP.y&+&startP.y)&*&(-endP.y&+&startP.y))));&&
&&&&&&&&&&&&&&&&&&&&y4&=&(int)(endP.y&-&ra&*&((-endP.y&+&startP.y)&/&sqrt((-endP.x&+&startP.x)&*&(-endP.x&+&startP.x)&+&(-endP.y&+&startP.y)&*&(-endP.y&+&startP.y))));&&
&&&&&&&&&&&&&&&&&&&&SetCursorPos(x4,&y4);&&
&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&}&&
&&&&&&&&&&&&return&0;&&
&&&&&&&&case&WM_SIZE&:&&&
&&&&&&&&&&&&if(flag==1)&&
&&&&&&&&&&&&{&&
&&&&&&&&&&&&&&&&Draw(hwnd,"第1点已锁定!");&&
&&&&&&&&&&&&}&&
&&&&&&&&&&&&else&if(flag==2)&&
&&&&&&&&&&&&{&&
&&&&&&&&&&&&&&&&Draw(hwnd,"第2点已锁定!");&&
&&&&&&&&&&&&}&&
&&&&&&&&&&&&else&&
&&&&&&&&&&&&{InvalidateRect&(hwnd,&NULL,&TRUE)&;&}&&
&&&&&&&&&&&&return&0&;&&
&&&&&&&&case&WM_KILLFOCUS:&&
&&&&&&&&&&&&InvalidateRect&(hwnd,&NULL,&TRUE)&;&&
&&&&&&&&&&&&hdc&=&BeginPaint&(hwnd,&&ps)&;&&
&&&&&&&&&&&&GetClientRect&(hwnd,&&rc)&;&&
&&&&&&&&&&&&hBrush&=&CreateSolidBrush&(&RGB(255,0,0)&)&;&&
&&&&&&&&&&&&FillRect&(hdc,&&rc,&hBrush)&;&&
&&&&&&&&&&&&EndPaint&(hwnd,&&ps)&;&&
&&&&&&&&&&&&ReleaseDC(hwnd,hdc);&&
&&&&&&&&&&&&DeleteObject&(hBrush)&;&&
&&&&&&&&&&&&return&0;&&
&&&&&&&&case&WM_SETFOCUS:&&
&&&&&&&&&&&&InvalidateRect&(hwnd,&NULL,&TRUE)&;&&
&&&&&&&&&&&&if(flag==1)&&
&&&&&&&&&&&&{&&
&&&&&&&&&&&&&&&&Draw(hwnd,"第1点已锁定!");&&
&&&&&&&&&&&&}&&
&&&&&&&&&&&&else&if(flag==2)&&
&&&&&&&&&&&&{&&
&&&&&&&&&&&&&&&&Draw(hwnd,"第2点已锁定!");&&
&&&&&&&&&&&&}&&
&&&&&&&&&&&&return&0;&&
&&&&&&&&case&WM_DESTROY&:&&
&&&&&&&&&&&&PostQuitMessage&(0)&;&&
&&&&&&&&&&&&return&0&;&&
&&&&return&DefWindowProc(hwnd,&message,&wParam,&lParam)&;&&
但是问题还存在,就是手动找圆心太麻烦,一般用触摸板比鼠标方便,但是仍然很不智能,于是一直想着用图像处理的方法去自动找圆心。
这几天在做数模,经常用到Matlab,刚做了一道要处理图像的题,正好想起这个问题来,于是,搁置的瞄准器继续开始完善了。
很快就有了思路,通过C#截图,然后Matlab进行图像滤波,灰度化,二值化以及边缘提取,然后进行圆曲线拟合,最后找到圆心,返回到C#中使用,代替手动找点。
首先,我用Matlab写了个函数:
function&[x,y]=findcenter()&&
%close&all,clear,clc&&
format&short&&
a=imread('E:\360data\重要数据\桌面\test.bmp');&&
b=rgb2gray(a);%转化为灰度图像&&
%imshow(b)&&
b=filter2(fspecial('average',1),b)/255;&&
%b=medfilt2(b);%中值滤波&&
level=graythresh(b);%自动获取灰度图片的阈值&&
c=im2bw(b,level);%二值化&&
%imshow(c)&&
bw=edge(c,'canny');&&
bw1=~%取反,黑变白,白变黑&&
%imshow(bw1)&&
%imshow(bw1)&&
[yf,xf]=find(bw1==0);&&
xmin=min(xf);&&
xmax=max(xf);&&
ymin=min(yf);&&
ymax=max(yf);&&
%cirPx=[(xmax-xmin)/2;(xmax-xmin)/2;xmax]&&
%cirPy=[(ymax-ymin)/2;(ymax-ymin)/2]&&
%fitellse(cirPx,cirPy)&&
centerX=(xmax+xmin)/2;&&
centerY=(ymax+ymin)/2;&&
ra=(ymax-ymin)/2;&&
x=centerX;y=centerY;&&
%hold&on&&
%x=0:size(bw1,2);&&
%degree=[0:0.01:pi*2];&&
%degree=[0:0.01:pi*2];&&
%plot(ra*cos(degree)+centerX,ra*sin(degree)+centerY,'r-');&&
%plot(centerX,centerY,'r+');&&
然后用Matlab2010b里的deploytool导出.net能使用的程序集dll文件(不知道为什么malab2009b在build时出现.net framework相关的错误),通过C#添加引用,调用其返回的参数,成功完成自动拾取圆心。
改进后代码如下:
Csharp代码&
using&System.D&&
using&System.Windows.F&&
using&System.W&&
using&System.Runtime.InteropS&&
using&MathWorks.MATLAB.NET.A&&
using&MathWorks.MATLAB.NET.U&&
namespace&TaiqiuGua&&
&&&&public&partial&class&Form1&:&Form&&
&&&&&&&&const&int&ra=25;&&
&&&&&&&&[DllImport("user32.dll")]&&
&&&&&&&&static&extern&IntPtr&GetDesktopWindow();&&
&&&&&&&&[DllImport("user32.dll")]&&
&&&&&&&&static&extern&IntPtr&GetWindowDC(IntPtr&hWnd);&&
&&&&&&&&[DllImport("user32.dll")]&&
&&&&&&&&static&extern&bool&SetCursorPos(int&X,&int&Y);&&
&&&&&&&&public&Form1()&&
&&&&&&&&{&&
&&&&&&&&&&&&InitializeComponent();&&
&&&&&&&&}&&
&&&&&&&&Point&startP,startP1;&&
&&&&&&&&Point&endP,endP1;&&
&&&&&&&&&&
&&&&&&&&private&void&Form1_KeyDown(object&sender,&KeyEventArgs&e)&&
&&&&&&&&{&&
&&&&&&&&&&&&switch(e.KeyData)&&
&&&&&&&&&&&&{&&
&&&&&&&&&&&&&&&&case&Keys.F1:&&
&&&&&&&&&&&&&&&&&&&&startP=Control.MouseP&&
&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&case&Keys.F5:&&
&&&&&&&&&&&&&&&&&&&&endP&=&Control.MouseP&&
&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&case&Keys.F2:&&
&&&&&&&&&&&&&&&&&&&&startP1&=&Control.MouseP&&
&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&case&Keys.F3:&&
&&&&&&&&&&&&&&&&&&&&endP1&=&Control.MouseP&&
&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&case&Keys.D1:&&
&&&&&&&&&&&&&&&&&&&&int&x1&=&(int)(endP.X&+&ra&*&((endP.X&-&startP.X)&/&Math.Sqrt((endP.X&-&startP.X)&*&(endP.X&-&startP.X)&+&(endP.Y&-&startP.Y)&*&(endP.Y&-&startP.Y))));&&
&&&&&&&&&&&&&&&&&&&&int&y1&=&(int)(endP.Y&+&ra&*&((endP.Y&-&startP.Y)&/&Math.Sqrt((endP.X&-&startP.X)&*&(endP.X&-&startP.X)&+&(endP.Y&-&startP.Y)&*&(endP.Y&-&startP.Y))));&&
&&&&&&&&&&&&&&&&&&&&SetCursorPos(x1,&y1);&&
&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&case&Keys.D2:&&
&&&&&&&&&&&&&&&&&&&&int&x2&=&(int)(endP.X&-&ra&*&((-endP.X&+&startP.X)&/&Math.Sqrt((-endP.X&+&startP.X)&*&(-endP.X&+&startP.X)&+&(endP.Y&-&startP.Y)&*&(endP.Y&-&startP.Y))));&&
&&&&&&&&&&&&&&&&&&&&int&y2&=&(int)(endP.Y&+&ra&*&((endP.Y&-&startP.Y)&/&Math.Sqrt((-endP.X&+&startP.X)&*&(-endP.X&+&startP.X)&+&(endP.Y&-&startP.Y)&*&(endP.Y&-&startP.Y))));&&
&&&&&&&&&&&&&&&&&&&&SetCursorPos(x2,&y2);&&
&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&case&Keys.D3:&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&int&x3&=&(int)(endP.X&+&ra&*&((endP.X&-&startP.X)&/&Math.Sqrt((endP.X&-&startP.X)&*&(endP.X&-&startP.X)&+&(-endP.Y&+&startP.Y)&*&(-endP.Y&+&startP.Y))));&&
&&&&&&&&&&&&&&&&&&&&int&y3&=&(int)(endP.Y&-&ra&*&((-endP.Y&+&startP.Y)&/&Math.Sqrt((endP.X&-&startP.X)&*&(endP.X&-&startP.X)&+&(-endP.Y&+&startP.Y)&*&(-endP.Y&+&startP.Y))));&&
&&&&&&&&&&&&&&&&&&&&SetCursorPos(x3,&y3);&&
&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&case&Keys.D4:&&
&&&&&&&&&&&&&&&&&&&&int&x4&=&(int)(endP.X&-&ra&*&((-endP.X&+&startP.X)&/&Math.Sqrt((-endP.X&+&startP.X)&*&(-endP.X&+&startP.X)&+&(-endP.Y&+&startP.Y)&*&(-endP.Y&+&startP.Y))));&&
&&&&&&&&&&&&&&&&&&&&int&y4&=&(int)(endP.Y&-&ra&*&((-endP.Y&+&startP.Y)&/&Math.Sqrt((-endP.X&+&startP.X)&*&(-endP.X&+&startP.X)&+&(-endP.Y&+&startP.Y)&*&(-endP.Y&+&startP.Y))));&&
&&&&&&&&&&&&&&&&&&&&SetCursorPos(x4,&y4);&&
&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&case&Keys.F4:&&
&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&int&w=endP1.X&-&startP1.X;&&
&&&&&&&&&&&&&&&&&&&&int&h=endP1.Y&-&startP1.Y;&&
&&&&&&&&&&&&&&&&&&&&Bitmap&bmSave&=&new&Bitmap(w,h);&&
&&&&&&&&&&&&&&&&&&&&Graphics&g=Graphics.FromImage(bmSave);&&
&&&&&&&&&&&&&&&&&&&&g.CopyFromScreen(startP1.X,startP1.Y,0,0,new&Size(w,h),CopyPixeltion.SourceCopy);&&
&&&&&&&&&&&&&&&&&&&&bmSave.Save(@"E:\360data\重要数据\桌面\test.bmp");&&
&&&&&&&&&&&&&&&&&&&&g.Dispose();&&
&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&bmSave.Dispose();&&
&&&&&&&&&&&&&&&&&&&&findcenter.Class1&f&=&new&findcenter.Class1();&&&&&&&
&&&&&&&&&&&&&&&&&&&&MWArray&centerx&=&f.findcenter();&&
&&&&&&&&&&&&&&&&&&&&MWArray&centery&=&f.findy();&&
&&&&&&&&&&&&&&&&&&&&double[,]&x&=&(double[,])centerx.ToArray();&&
&&&&&&&&&&&&&&&&&&&&double[,]&y&=&(double[,])centery.ToArray();&&
&&&&&&&&&&&&&&&&&&&&SetCursorPos((int)(x[0,&0]&+&startP1.X),&(int)(y[0,&0]&+&startP1.Y));&&
&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&f.Dispose();&&
&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&}&&
&&&&&&&&&&&&GC.Collect();&&
&&&&&&&&}&&
&&&&&&&&private&void&Form1_Activated(object&sender,&EventArgs&e)&&
&&&&&&&&{&&
&&&&&&&&&&&&
&&&&&&&&}&&
&&&&&&&&private&void&Form1_Deactivate(object&sender,&EventArgs&e)&&
&&&&&&&&{&&
&&&&&&&&&&&&
&&&&&&&&}&&
经试验,成功率也很高,偶尔出现不准(估计是边缘提取和计算精度的问题),但是大多数偏差可以手动修正。
到此为止,改进版全部完成。希望以后继续改进,更加智能化。C#&真是码农的利器啊!
优质网站模板}

我要回帖

更多关于 qq2d桌球瞄准器 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信