c# - background color not changing in circular application -


i'm playing around visual controls , colors in simple background color changing program i've written. wanted incorporate circular application window, did creating bitmap of solid circle surrounded black , making black transparent. ground color doesn't loop. can tell me how fix this. ill include code in case helps think form properties problem. help!

public partial class form1 : form {     public form1()     {         initializecomponent();           }      public point mouse_offset;     public int c;      private void button1_click(object sender, eventargs e)     {         using (speechsynthesizer synth = new system.speech.synthesis.speechsynthesizer())         {             synth.speak("this test of emergency see sharp broadcasting network!");             synth.speak("the man left trying dance without graphics capabilities");          }         while (visible)         {             using (speechsynthesizer synth = new system.speech.synthesis.speechsynthesizer())             {                 synth.speak("flash dance commencing in three. two. one.");             }             while (visible)             {                 (int c = 0; c < 255 && visible; c++)                 {                     this.backcolor = color.fromargb(c, 255 - c, c);                     application.doevents();                     //slow();                  }                   (int c = 255; c > 0 && visible; c--)                 {                     this.backcolor = color.fromargb(c, 255 - c, c);                     application.doevents();                     //slow();                  }              }         }     }      public static void slow()     {         system.threading.thread.sleep(3);     }      private void button2_click(object sender, eventargs e)     {         this.close();     }      private void form1_mousedown(object sender, mouseeventargs e)     {         mouse_offset = new point(-e.x, -e.y);      }      private void form1_mousemove(object sender, system.windows.forms.mouseeventargs e)     {         if (e.button == mousebuttons.left)          {             point mousepos = control.mouseposition;              mousepos.offset(mouse_offset.x, mouse_offset.y);             location = mousepos;         }     }   } 

}

every time have changed looks of component , want display change, call

mycomponent.invalidate(); 

this forces conponent redraw itself. you're there, there number of ways optimize redraws, think above should started.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -