When is the PictureBox redrawn?
-
Hello everyone I've written a little application to load pictures and display them on a windows form at the same time. What I've done is put a group of PictureBoxes onto a scrollable panel, and let the PictureBoxes draw their contained images. However, I find it's very unefficient. When I scroll the containing panel up and down, the already drawn PictureBoxes are redrawn again, which is quite undesirable. So I'm wondering which event causes the PictureBoxes to be redrawn? And when will the event be raised? Worse still, I even have no idea which one is doing the actual drawing job, the PictureBoxes or the containing panel? Can anyone help me with this? Thank you!
-
Hello everyone I've written a little application to load pictures and display them on a windows form at the same time. What I've done is put a group of PictureBoxes onto a scrollable panel, and let the PictureBoxes draw their contained images. However, I find it's very unefficient. When I scroll the containing panel up and down, the already drawn PictureBoxes are redrawn again, which is quite undesirable. So I'm wondering which event causes the PictureBoxes to be redrawn? And when will the event be raised? Worse still, I even have no idea which one is doing the actual drawing job, the PictureBoxes or the containing panel? Can anyone help me with this? Thank you!
Not exactly answering your question, but the general advice is to avoid using PictureBoxes, and do your own custom painting directly.
-- Help me! I'm turning into a grapefruit! Buzzwords!