bool draw; private void Form1_Load(object sender, EventArgs e) { pictureBox1.Image = new Bitmap("Image.jpg"); draw = true; Thread DataRead = new Thread (Data_Read); DataRead.Start(); } public void DataRead() { //code for data reading//; if (data_read !=null) { draw = true; } else { draw = false; } } private void picbox_paint(object sender, PaintEventArgs e) { if (draw == true) { e.Graphics.DrawImage(new Bitmap("interface.png"), Convert.ToInt32(x), Convert.ToInt32(w), 16, 16); e.Graphics.DrawImage(new Bitmap("interface.png"), Convert.ToInt32(z), Convert.ToInt32(y), 16, 16); } else { // what should I do in this part? } e.Dispose(); pictureBox1.invalidate(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)