当前位置: 首页 > news >正文

网站客服图标百度官方版下载

网站客服图标,百度官方版下载,宝山专业网站建设,网站建设那个网站好大概的思路是这样的:首先1.找到游戏窗口-> 2.解析方块的位置、图案-> 3.遍历方块,找到可以消去的方块-> …

大概的思路是这样的:首先1.找到游戏窗口->
                                                2.解析方块的位置、图案->
                                                3.遍历方块,找到可以消去的方块->
                                                4.计算方块在窗口中的位置,模拟鼠标点击。 

 



大家都知道连连看的规则是:如果两个方块的连线小于等于两个直角时,这对方块就可以消去。所以除了两个方块之间用直线连接外,还有另外这两种情况。

 

1.一个直角
连连看示意图-1

2.两个直角

连连看示意图-2

根据上述情况,就可以归纳出一种统一的算法。即:首先找出图案相同的两个方块,分别向他们的四个方向引出四条线段,线段的另一端终止于边缘,或者其它的方块处。分别判断水平与水平、竖直与竖直方向的线段的横坐标、纵坐标是否有交集。如果没有两个方向都没有交集,则这两个方块不能消去。如果有,再在任一条线段有交集的位置向另一条线段连线,如果连线成功(中间无无方块阻碍或者两线段相连),则两方块可以消去。 

至于方块图案的判断,是因为背景的图案颜色非常靠近(现在“角色版”索性为单色背景),分别取最亮处,与最暗处的RGB值。找出R,G,B值的最大、最小值。判断的时候是在方块上取出任意几个点的(程序中为4个点)RGB值,如果这四个点的R,G,B值都在背景色R,G,B的最大、最小值的范围内,则断定这个方格上没有方块。

其中比较重要的两个技巧就是这样。我把主要的代码贴出来:

 

class  CLLKer  
{
public:
    CLLKer();
    
virtual ~CLLKer();

    
// 设置窗口标题
    void SetWndCaption(CString strCaption){ m_strWndCaption = strCaption; }

    
// 设置方块个数
    void SetCellCount(UINT nHorCount, UINT nVerCount) 
        m_nHorCellCount 
= nHorCount;
        m_nVerCellCount 
= nVerCount;
    }


    
// 设置单元格大小
    void SetCellSize(UINT nWidth, UINT nHeight) {
        m_nCellWidth 
= nWidth;
        m_nCellHeight 
= nHeight;
    }

    
    
// 设置边界
    void SetMagin(UINT nLeft, UINT nTop) {
        m_nMargin_X 
= nLeft;
        m_nMargin_Y 
= nTop;
    }
    

    


    BOOL LockWnd();                    
// 锁定窗口
    UINT Encode();                    // 扫描窗口记录布局信息
    BOOL EliminateOnePair();
    
void EliminateAll();
    
    BOOL CheckWnd();
    
void Reset();

private:
    
    
//
    // 功能函数
    int CompareTowColor(COLORREF cColor1, COLORREF cColor2);    // 返回两颜色的RGB的差值和
    int SearchColor(COLORS color);                            // 取得颜色相同的Cell索引值

    
void FindXLine(const POS& pos, int& iLeft, int& iRight);            // 取得水平方向的路径
    void FindYLine(const POS& pos, int& iTop, int& iLow);                // 取得竖直方向的路径

    BOOL IsXPath(
const POS& pos1, const POS& pos2);        // 水平方向的路径是否相通
    BOOL IsYPath(const POS& pos1, const POS& pos2);        // 竖直方向的路径是否相通
    BOOL IsPath(const POS& pos1, const POS& pos2);        // 判断两单元格是否存在连通路径

    BOOL FindMatchingCell(
const POS& pos, POS& posMathed);    // 找到指定方块的匹配方块
    BOOL FindPair(POS& posOri, POS& posMathed);                // 找到一对可消除的方块

    
void ReleaseData();

    
//
    // 中间变量
    int **m_pMap;            // 单元格布局
    CWnd *m_pWnd;            // 游戏窗口
    vector<CELL> m_vCells;    // 单元格信息

    
//
    // 参数
    CString m_strWndCaption;
    UINT m_nHorCellCount;
    UINT m_nVerCellCount;
    UINT m_nCellWidth;
    UINT m_nCellHeight;
    UINT m_nMargin_X;
    UINT m_nMargin_Y;

    UINT m_nMax_R;
    UINT m_nMax_G;
    UINT m_nMax_B;
    UINT m_nMin_R;
    UINT m_nMin_G;
    UINT m_nMin_B;
}
;

 

class  CAboutDlg :  public  CDialog
{
public:
    CAboutDlg();

// Dialog Data
    
//{{AFX_DATA(CAboutDlg)
    enum { IDD = IDD_ABOUTBOX };
    
//}}AFX_DATA

    
// ClassWizard generated virtual function overrides
    
//{{AFX_VIRTUAL(CAboutDlg)
    protected:
    
virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
    
//}}AFX_VIRTUAL

// Implementation
protected:
    
//{{AFX_MSG(CAboutDlg)
    
//}}AFX_MSG
    DECLARE_MESSAGE_MAP()
}
;

CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
    
//{{AFX_DATA_INIT(CAboutDlg)
    
//}}AFX_DATA_INIT
}


void  CAboutDlg::DoDataExchange(CDataExchange *  pDX)
{
    CDialog::DoDataExchange(pDX);
    
//{{AFX_DATA_MAP(CAboutDlg)
    
//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
    
// {{AFX_MSG_MAP(CAboutDlg)
        
//  No message handlers
    
// }}AFX_MSG_MAP
END_MESSAGE_MAP()

/////
//  CLLKDlg dialog

CLLKDlg::CLLKDlg(CWnd
*  pParent  /*=NULL*/ )
    : CDialog(CLLKDlg::IDD, pParent)
{
    
//{{AFX_DATA_INIT(CLLKDlg)
    m_bAutoElmit = FALSE;
    m_bIsTopMost 
= FALSE;
    
//}}AFX_DATA_INIT
    
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
    m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);

    m_bStarted 
= FALSE;
}


void  CLLKDlg::DoDataExchange(CDataExchange *  pDX)
{
    CDialog::DoDataExchange(pDX);
    
//{{AFX_DATA_MAP(CLLKDlg)
    DDX_Check(pDX, IDC_CHK_AUTO, m_bAutoElmit);
    DDX_Check(pDX, IDC_CHK_TOPMOST, m_bIsTopMost);
    
//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CLLKDlg, CDialog)
    
// {{AFX_MSG_MAP(CLLKDlg)
    ON_WM_SYSCOMMAND()
    ON_WM_PAINT()
    ON_WM_QUERYDRAGICON()
    ON_BN_CLICKED(IDC_LOCK, OnLock)
    ON_BN_CLICKED(IDC_ENCODE, OnEncode)
    ON_BN_CLICKED(IDC_DELETE, OnDelete)
    ON_WM_TIMER()
    ON_BN_CLICKED(IDC_CHK_TOPMOST, OnChkTopmost)
    
// }}AFX_MSG_MAP
END_MESSAGE_MAP()

/////
//  CLLKDlg message handlers

BOOL CLLKDlg::OnInitDialog()
{
    CDialog::OnInitDialog();

    
// Add "About..." menu item to system menu.

    
// IDM_ABOUTBOX must be in the system command range.
    ASSERT((IDM_ABOUTBOX & 0xFFF0== IDM_ABOUTBOX);
    ASSERT(IDM_ABOUTBOX 
< 0xF000);

    CMenu
* pSysMenu = GetSystemMenu(FALSE);
    
if (pSysMenu != NULL)
    
{
        CString strAboutMenu;
        strAboutMenu.LoadString(IDS_ABOUTBOX);
        
if (!strAboutMenu.IsEmpty())
        
{
            pSysMenu
->AppendMenu(MF_SEPARATOR);
            pSysMenu
->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
        }

    }


    
// Set the icon for this dialog.  The framework does this automatically
    
//  when the application's main window is not a dialog
    SetIcon(m_hIcon, TRUE);            // Set big icon
    SetIcon(m_hIcon, FALSE);        // Set small icon
    
    
// TODO: Add extra initialization here
    ////
    // 取得配置文件路径
    char szModulPath[_MAX_PATH] = {0};
    GetModuleFileName(NULL, szModulPath, _MAX_PATH);
    CString strPath 
= szModulPath;
    
int iPos = strPath.ReverseFind('/');
    m_strInitPath 
= strPath.Left(iPos+1);
    m_strInitPath 
+= "CONFIG.INI";
    
////

    CRect rcWnd;
    GetWindowRect(rcWnd);

    
int iPos_X = GetPrivateProfileInt("OPTION""POS_X"500, m_strInitPath);
    
int iPos_Y = GetPrivateProfileInt("OPTION""POS_Y"700, m_strInitPath);
    
    rcWnd.OffsetRect(iPos_X, iPos_Y);

    MoveWindow(rcWnd, FALSE);

    BOOL m_bIsTopMost 
= GetPrivateProfileInt("OPTION""TOPMOST"0, m_strInitPath);
    CheckDlgButton(IDC_CHK_TOPMOST, m_bIsTopMost);
    HWND hWnd 
= this->GetSafeHwnd();
    
    
if ( m_bIsTopMost )
        ::SetWindowPos(hWnd, HWND_TOPMOST, 
0000, SWP_NOMOVE|SWP_NOSIZE);
    
else
        ::SetWindowPos(hWnd, HWND_NOTOPMOST, 
0000, SWP_NOMOVE|SWP_NOSIZE);

    SetTimer(
1100, NULL);

    
return TRUE;  // return TRUE  unless you set the focus to a control
}


void  CLLKDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
    
if ((nID & 0xFFF0== IDM_ABOUTBOX)
    
{
        CAboutDlg dlgAbout;
        dlgAbout.DoModal();
    }

    
else
    
{
        CDialog::OnSysCommand(nID, lParam);
    }

}


//  If you add a minimize button to your dialog, you will need the code below
//   to draw the icon.  For MFC applications using the document/view model,
//   this is automatically done for you by the framework.

void  CLLKDlg::OnPaint() 
{
    
if (IsIconic())
    
{
        CPaintDC dc(
this); // device context for painting

        SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 
0);

        
// Center icon in client rectangle
        int cxIcon = GetSystemMetrics(SM_CXICON);
        
int cyIcon = GetSystemMetrics(SM_CYICON);
        CRect rect;
        GetClientRect(
&rect);
        
int x = (rect.Width() - cxIcon + 1/ 2;
        
int y = (rect.Height() - cyIcon + 1/ 2;

        
// Draw the icon
        dc.DrawIcon(x, y, m_hIcon);
    }

    
else
    
{
        CDialog::OnPaint();
    }

}


//  The system calls this to obtain the cursor to display while the user drags
//   the minimized window.
HCURSOR CLLKDlg::OnQueryDragIcon()
{
    
return (HCURSOR) m_hIcon;
}


void  CLLKDlg::OnLock() 
{
    
// TODO: Add your control notification handler code here
    if ( m_LLKer.LockWnd() ) 
    
{
        AfxMessageBox(
"锁定成功", MB_ICONINFORMATION);

        m_bStarted 
= TRUE;
        
return;
    }

    AfxMessageBox(
"未找到游戏窗口,请确认窗口名称是否正确", MB_ICONERROR);
}


void  CLLKDlg::OnEncode() 
{
    
// TODO: Add your control notification handler code here
    UINT nBlock = m_LLKer.Encode();
    
if ( nBlock > 0 )
    
{
        AfxMessageBox(
"解析成功!", MB_ICONINFORMATION);
    }

}


void  CLLKDlg::OnDelete() 
{
    
// TODO: Add your control notification handler code here
    UpdateData(TRUE);

    POINT ptCursor;
    
    
int iRes = ::GetCursorPos(&ptCursor);

    
if ( m_bAutoElmit )
    
{
        m_LLKer.EliminateAll();
        ::SetCursorPos(ptCursor.x, ptCursor.y);
    }

    
else
    
{
        
if ( m_LLKer.EliminateOnePair() )
            ::SetCursorPos(ptCursor.x, ptCursor.y);
    }

}


void  CLLKDlg::OnTimer(UINT nIDEvent) 
{
    
// TODO: Add your message handler code here and/or call default
    if ( !m_LLKer.CheckWnd() && m_bStarted )
    
{
        m_LLKer.Reset();
    }

    CDialog::OnTimer(nIDEvent);
}


void  CLLKDlg::OnChkTopmost() 
{
    
// TODO: Add your control notification handler code here
    UpdateData(TRUE);
    
    HWND hWnd 
= this->GetSafeHwnd();

    
if ( m_bIsTopMost )
        ::SetWindowPos(hWnd, HWND_TOPMOST, 
0000, SWP_NOMOVE|SWP_NOSIZE);
    
else
        ::SetWindowPos(hWnd, HWND_NOTOPMOST, 
0000, SWP_NOMOVE|SWP_NOSIZE);

    CString strBuf;
    strBuf.Format(
"%d", m_bIsTopMost);
    WritePrivateProfileString(
"OPTION""TOPMOST", strBuf, m_strInitPath);
}


BOOL CLLKDlg::DestroyWindow() 
{
    
// TODO: Add your specialized code here and/or call the base class

    CRect rcWnd;
    GetWindowRect(rcWnd);
    
    CString strBuf;

    strBuf.Format(
"%d", rcWnd.left);
    WritePrivateProfileString(
"OPTION""POS_X", strBuf, m_strInitPath);
    strBuf.Format(
"%d", rcWnd.top);
    WritePrivateProfileString(
"OPTION""POS_Y", strBuf, m_strInitPath);

    
return CDialog::DestroyWindow();
}


文章转载自:
http://marriageable.pfbx.cn
http://unitarianism.pfbx.cn
http://raddled.pfbx.cn
http://nicene.pfbx.cn
http://hydrocephalic.pfbx.cn
http://gloriously.pfbx.cn
http://portreeve.pfbx.cn
http://thyreoid.pfbx.cn
http://cilium.pfbx.cn
http://bartizan.pfbx.cn
http://allopatrically.pfbx.cn
http://gadolinite.pfbx.cn
http://themselves.pfbx.cn
http://papilio.pfbx.cn
http://sandbag.pfbx.cn
http://screwloose.pfbx.cn
http://revolving.pfbx.cn
http://chanceless.pfbx.cn
http://clincherwork.pfbx.cn
http://dekalitre.pfbx.cn
http://conduce.pfbx.cn
http://photoconductor.pfbx.cn
http://druidical.pfbx.cn
http://fixity.pfbx.cn
http://trivalence.pfbx.cn
http://suspiration.pfbx.cn
http://trinkum.pfbx.cn
http://phytobiology.pfbx.cn
http://knoxville.pfbx.cn
http://geometrize.pfbx.cn
http://reposition.pfbx.cn
http://personalism.pfbx.cn
http://ricinolein.pfbx.cn
http://cleaver.pfbx.cn
http://brasilin.pfbx.cn
http://string.pfbx.cn
http://chekiang.pfbx.cn
http://cooling.pfbx.cn
http://ecdyses.pfbx.cn
http://metabiology.pfbx.cn
http://benthograph.pfbx.cn
http://tenson.pfbx.cn
http://karstology.pfbx.cn
http://refund.pfbx.cn
http://topicality.pfbx.cn
http://pulmometry.pfbx.cn
http://biflex.pfbx.cn
http://polychaetan.pfbx.cn
http://overpowering.pfbx.cn
http://climacteric.pfbx.cn
http://diarrhea.pfbx.cn
http://echovirus.pfbx.cn
http://grand.pfbx.cn
http://stereograph.pfbx.cn
http://atrato.pfbx.cn
http://fjeld.pfbx.cn
http://monostomous.pfbx.cn
http://cutdown.pfbx.cn
http://troublous.pfbx.cn
http://nightly.pfbx.cn
http://withstand.pfbx.cn
http://dashed.pfbx.cn
http://woodside.pfbx.cn
http://oba.pfbx.cn
http://watteau.pfbx.cn
http://bowler.pfbx.cn
http://duckboard.pfbx.cn
http://dichotomize.pfbx.cn
http://wishfully.pfbx.cn
http://colemouse.pfbx.cn
http://uphroe.pfbx.cn
http://illustration.pfbx.cn
http://cyanogenic.pfbx.cn
http://jingling.pfbx.cn
http://pyrolysate.pfbx.cn
http://isv.pfbx.cn
http://xenomania.pfbx.cn
http://miogeosyncline.pfbx.cn
http://yatata.pfbx.cn
http://depreter.pfbx.cn
http://mesomorphic.pfbx.cn
http://emp.pfbx.cn
http://smelly.pfbx.cn
http://semiannually.pfbx.cn
http://papalize.pfbx.cn
http://lazybones.pfbx.cn
http://uneventfully.pfbx.cn
http://aequum.pfbx.cn
http://descriptively.pfbx.cn
http://galactorrhea.pfbx.cn
http://firethorn.pfbx.cn
http://librarian.pfbx.cn
http://folkmoot.pfbx.cn
http://priggery.pfbx.cn
http://indigotine.pfbx.cn
http://tetrahydrofurfuryl.pfbx.cn
http://idealism.pfbx.cn
http://saghalien.pfbx.cn
http://cosmographer.pfbx.cn
http://cholestyramine.pfbx.cn
http://www.15wanjia.com/news/68476.html

相关文章:

  • 免费手机网站app上海哪家seo公司好
  • 二级建造师报名时间2022年官网汕头seo优化公司
  • 网站后台分析图怎么做网页设计网站建设
  • 给装修公司做网站做百度推广的公司电话号码
  • 重庆网站制作设计公司网络优化工程师骗局
  • chrome不安全的网站设置培训总结
  • 图片无法显示wordpress企业网站优化哪家好
  • 渭南华阴建设银行的网站是多少全网推广哪家正宗可靠
  • 沈阳中小企业网站建设网站维护工作内容
  • 青岛制作网站的微信平台推广方法
  • 米业做网站的好处万能推广app
  • 自己做网站卖水果windows优化大师怎么卸载
  • 教育培训机构网站模板重庆seo整站优化
  • 网络网站首页设计怎么开通百度推广账号
  • 政府网站建设原则推广网址
  • 网站建设公司发展方向及趋势推广有奖励的app平台
  • 一般的web网站开发平台是百度竞价推广培训
  • 中央农村工作会议12月19日至20日北京seo公司wyhseo
  • 怎么做网站评估app推广是做什么的
  • 微山建设局网站观看b站的广告网站平台
  • 试玩网站开发b站网页入口
  • 3g网站建设深圳seo外包
  • 为什么说新浪的门户网站做的好推广竞价托管费用
  • 广州越秀区风险等级seo网站查询
  • 西安装修公司网站制作联合早报 即时消息
  • 武安网站建设价格公司产品推广方案
  • 北京 工业网站建设公司价格手机百度app
  • 三门网站建设色盲测试图 考驾照
  • 中山 灯饰 骏域网站建设专家整站seo技术
  • 优购物官方网站购物深圳创新创业大赛