C# 三種實現抖屏的方式

來源:互聯網
上載者:User

標籤:style   blog   color   io   for   re   

 1          //int a = -2; 2             //this.BringToFront(); 3             //for (int i = 0; i < 20; i++) 4             //{ 5             //    a = -a; 6             //    this.Location = new Point(this.Location.X + 6 * a, this.Location.Y + 8 * a); 7  8             //    Thread.Sleep(100); 9 10             //}11             //2.12             //int X = this.Top; int Y = this.Left;13 14             //for (int i = 0; i < 100; i++)15             //{16 17             //    this.Top = this.Top + 10;18 19             //    this.Left = this.Left + 10;20 21             //    this.Top = this.Top - 10;22 23             //    this.Left = this.Left - 10;24 25             //}26 27             ////回到原來的位置28 29             //this.Top = X;30             //this.Left = Y;31 32             //3.33             Point pOld = this.Location;//原來的位置 34             int radius = 3;//半徑 35             for (int n = 0; n < 3; n++) //旋轉圈數 36             {37                 //右半圓逆時針 38                 for (int i = -radius; i <= radius; i++)39                 {40                     int x = Convert.ToInt32(Math.Sqrt(radius * radius - i * i));41 42                     int y = -i;43 44                     this.Location = new Point(pOld.X + x, pOld.Y + y);45 46                     System.Threading.Thread.Sleep(10);47 48 49                 }50 51                 //左半圓逆時針52                 for (int j = radius; j >= -radius; j--)53                 {54                     int x = -Convert.ToInt32(Math.Sqrt(radius * radius - j * j));55                     int y = -j;56                     this.Location = new Point(pOld.X + x, pOld.Y + y);57                     System.Threading.Thread.Sleep(10);58                 }59             }60 61             this.Location = pOld;
相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.