zoukankan      html  css  js  c++  java
  • iPhone中判断是否点击在某个圆形内

    1. - (BOOL) pointInside:(CGPoint)point withEvent:(UIEvent *)event   
    2. {  
    3. CGPoint pt;  
    4. float HALFSIDE = SIDELENGTH / 2.0f;  
    5. // normalize with centered origin  
    6. pt.x = (point.x - HALFSIDE) / HALFSIDE;  
    7. pt.y = (point.y - HALFSIDE) / HALFSIDE;  
    8. // x^2 + y^2 = radius  
    9. float xsquared = pt.x * pt.x;  
    10. float ysquared = pt.y * pt.y;  
    11. // If the radius < 1, the point is within the clipped circle  
    12. if ((xsquared + ysquared) < 1.0return YES;  
    13. return NO;  
    14. }  

    id 博主 = [[KILONET.CNBLOGS.COM alloc] initWithValue:@"天堂向右,我依然向左"

                  网名:@"老舟"

                  兴趣:@"影音,阅读"

                  动态:@"系统架构设计,Android通信模块开发"

                  网址:@"http://kilonet.cnblogs.com"
                  签名:@"--------------------------------------------------

                                  Stay Hungry , Stay Foolish

                                  求  知  若  渴,处  事  若  愚

                              --------------------------------------------------"

                  ];         // Never Release

  • 相关阅读:
    实验吧因缺思汀的绕过注入解析
    python模块中requests参数stream
    土司论坛nc反弹神器使用方法
    msf web脚本反弹shell
    python 多线程
    metasploit后门维持技术
    ew做socks5代理
    双内网渗透代理之reGeorg+Proxifier
    SVN源码泄露漏洞
    Java反射的实例
  • 原文地址:https://www.cnblogs.com/KiloNet/p/1807320.html
Copyright © 2011-2022 走看看