Click here to Skip to main content
15,901,284 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# TableLayoutPanel MouseMove Too Much CPU Pin
Keith Barrow26-Feb-10 5:21
professionalKeith Barrow26-Feb-10 5:21 
AnswerRe: C# TableLayoutPanel MouseMove Too Much CPU Pin
Som Shekhar26-Feb-10 6:19
Som Shekhar26-Feb-10 6:19 
GeneralRe: C# TableLayoutPanel MouseMove Too Much CPU Pin
ikurtz26-Feb-10 6:23
ikurtz26-Feb-10 6:23 
GeneralRe: C# TableLayoutPanel MouseMove Too Much CPU Pin
Som Shekhar26-Feb-10 6:50
Som Shekhar26-Feb-10 6:50 
GeneralRe: C# TableLayoutPanel MouseMove Too Much CPU Pin
ikurtz26-Feb-10 6:56
ikurtz26-Feb-10 6:56 
GeneralRe: C# TableLayoutPanel MouseMove Too Much CPU Pin
ikurtz26-Feb-10 7:00
ikurtz26-Feb-10 7:00 
GeneralRe: C# TableLayoutPanel MouseMove Too Much CPU Pin
Som Shekhar26-Feb-10 7:01
Som Shekhar26-Feb-10 7:01 
QuestionDrawing onto a Windows Form without freezing it Pin
SimpleData26-Feb-10 4:06
SimpleData26-Feb-10 4:06 
AnswerRe: Drawing onto a Windows Form without freezing it Pin
Rob Philpott26-Feb-10 4:11
Rob Philpott26-Feb-10 4:11 
GeneralRe: Drawing onto a Windows Form without freezing it Pin
SimpleData26-Feb-10 4:18
SimpleData26-Feb-10 4:18 
AnswerRe: Drawing onto a Windows Form without freezing it Pin
Saksida Bojan26-Feb-10 4:15
Saksida Bojan26-Feb-10 4:15 
GeneralRe: Drawing onto a Windows Form without freezing it Pin
SimpleData26-Feb-10 4:24
SimpleData26-Feb-10 4:24 
GeneralRe: Drawing onto a Windows Form without freezing it Pin
Dan Mos26-Feb-10 4:34
Dan Mos26-Feb-10 4:34 
GeneralRe: Drawing onto a Windows Form without freezing it Pin
SimpleData26-Feb-10 4:40
SimpleData26-Feb-10 4:40 
GeneralRe: Drawing onto a Windows Form without freezing it Pin
Dan Mos26-Feb-10 4:47
Dan Mos26-Feb-10 4:47 
GeneralRe: Drawing onto a Windows Form without freezing it Pin
SimpleData26-Feb-10 4:54
SimpleData26-Feb-10 4:54 
GeneralRe: Drawing onto a Windows Form without freezing it Pin
Dan Mos26-Feb-10 5:02
Dan Mos26-Feb-10 5:02 
GeneralRe: Drawing onto a Windows Form without freezing it [modified] Pin
Luc Pattyn26-Feb-10 6:44
sitebuilderLuc Pattyn26-Feb-10 6:44 
GeneralRe: Drawing onto a Windows Form without freezing it Pin
Saksida Bojan26-Feb-10 4:43
Saksida Bojan26-Feb-10 4:43 
GeneralRe: Drawing onto a Windows Form without freezing it Pin
SimpleData26-Feb-10 5:17
SimpleData26-Feb-10 5:17 
GeneralRe: Drawing onto a Windows Form without freezing it Pin
Saksida Bojan26-Feb-10 5:28
Saksida Bojan26-Feb-10 5:28 
GeneralRe: Drawing onto a Windows Form without freezing it Pin
SimpleData26-Feb-10 5:44
SimpleData26-Feb-10 5:44 
I now got it working. It is the incorrect usage but whatever, it seems to be working. The only problem I've left is the issue when the windows gets out of sight, the drawings I did are gone. How can I solve this?

private void SetPixel(Point xy, Color clr)
{
  Graphics dc = this.CreateGraphics();
  Pen _pen = new Pen(clr, 1);

  dc.DrawRectangle(_pen, new Rectangle( xy, new Size(1,1) ) );

  _pen.Dispose(); dc.Dispose();
}

private void button1_Click_1(object sender, EventArgs e)
{
  Thread th = new Thread( new ThreadStart(Dummy) );
  th.Name = "Drawer";
  th.Start();
}

private void Dummy()
{
  Random rnd = new Random();
  int buff = 0;

  for (int y = 0; y < 300; y++)
  {
    for (int x = 0; x < 300; x++)
    {
      buff = rnd.Next(0, 4);
      if (buff == 0)
        SetPixel(new Point(x,y),Color.Cyan);
      else if (buff == 1)
        SetPixel(new Point(x,y),Color.Magenta);
      else if (buff == 2)
        SetPixel(new Point(x,y),Color.Yellow);
      else if (buff == 3)
        SetPixel(new Point(x,y),Color.Black);
    }
  }
}

GeneralRe: Drawing onto a Windows Form without freezing it Pin
Saksida Bojan26-Feb-10 7:00
Saksida Bojan26-Feb-10 7:00 
GeneralRe: Drawing onto a Windows Form without freezing it Pin
Luc Pattyn26-Feb-10 6:46
sitebuilderLuc Pattyn26-Feb-10 6:46 
QuestionQuad Tree With images Pin
mallikharjunrao8426-Feb-10 3:17
mallikharjunrao8426-Feb-10 3:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.