-2

I have a Picturebox with...content approximately 2000x1080 pixel (yes, this makes sense for me) Now I need to get the old content, replace it 1 pixel down and fill the empty line on the top with new data.

BUT I have to do this in a very short time ~5ms maybe a little bit more. I get the trigger and the new data to do so.

So now the question is: What is the fastest and cleanest way to do this? Maybe I need to buffer the new data and write them in a more "human" time!?

  • What did you tried so far? – Jeroen van Langen Apr 07 '14 at 14:11
  • 1
    Have you tried redrawing the picturebox with the new box? What is the performance when you do that? ALso why ~5ms? Are you trying to get 200fps? Human eye cannot see that many fps, you might be better off, combining the last couple results and updating 2-3 lines at a time... – Michal Ciechan Apr 07 '14 at 14:14
  • I tried doing it every 5ms, and of course I couldnt access the content because it was still locked from the last access. Combining was my first though, I guess this is the way to do it. I dont want to reach 200fps but I get the new data every 5ms (realtime valve control...) – Christoph Schweppe Apr 07 '14 at 14:18
  • Yep, refreshing the image so frequently could be overkill. High quality motion picture playback is every 20 ms or so. –  Apr 07 '14 at 14:24
  • So is there any way to check if I'm able to load new content to the PictureBox? – Christoph Schweppe Apr 07 '14 at 14:28
  • I'm still a winforms guy but this sounds a lot like you should go for a WPF soluton. – TaW Apr 07 '14 at 15:01

1 Answers1

0

You didn't mention what kind of app it is... I'm more of a web developer, but in jquery, the trick to this is to load all images with zero visibility, and then use logic to determine which to display; I would think that even if this isn't web based, you could use a similar approach... just line them all up on the screen, set the left most to be visible, and then every 5ms, make the next visible... if you were constantly adding images, just make sure you're loading them earlier, maybe during the 5ms between switches?

Jon
  • 301
  • 1
  • 5
  • 19