They also feel like workaround instead of doing it properly :$ I know I can resize the image to fit the picturebox, or I can paint on the image loaded instead of painting on the picturebox itself.īut these all have drawbacks. When I place a breakpoint at the end of my paint event, then I see the grid nicely draw over the image (it's ugly, but it's a test :D). Private void pictureBox1_LoadProgressChanged(object sender, ProgressChangedEventArgs e)ĭebug.WriteLine("Process " e.ProgressPercentage.ToString() "%") Private void pictureBox1_LoadCompleted(object sender, AsyncCompletedEventArgs e)ĭebug.WriteLine("\tCanceled " e.Cancelled.ToString()) ĭebug.WriteLine("\tError " (e.Error = null ? "No error (null)" : e.Error.ToString())) ĭebug.WriteLine("\tUserState " (e.UserState = null ? "No userstate (null)" : e.UserState.ToString())) Using (Graphics g = ())įor (int xPos = 1 xPos < columnCount xPos )įor (int yPos = 1 yPos < rowCount yPos ) Private void button1_Click(object sender, EventArgs void pictureBox1_Paint(object sender, PaintEventArgs e) The grid keeps on disappearing (after being drawn). I don't want te resize the loaded image to the size of my picturebox.Īfter the image has been drawn on the canvas of the picturebox, I draw my grid. I want the grid to be visible at all times and I want the thickness of the lines to be the same at all times.
0 Comments
Leave a Reply. |