Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. When is the PictureBox redrawn?

When is the PictureBox redrawn?

Scheduled Pinned Locked Moved C#
graphicshelpquestioncareer
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SeeBees
    wrote on last edited by
    #1

    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!

    B 1 Reply Last reply
    0
    • S SeeBees

      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!

      B Offline
      B Offline
      benjymous
      wrote on last edited by
      #2

      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!

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups