K
kebalex
Hi,
I have an app (written in .NET 2.0) which updates a picturebox
according to some user input (a slider control). when the user makes a
change i loop through all of the pixels, do a calculation and update
the picture. i currently use the GDI SetPixel method on each pixel of
the Pictureboxes image. This is proving far to slow, about 1.5 seconds
on average. This app needs to display the update as fast as possible.
Has anyone got any ideas as to how to speed this up? i was thinking
about trying to access the picturebox's memory space directly, pseudo
code:
For Each pixel in <PictureBox.Image's bytearray>
<PictureBox.Image's bytearray> (pixel) = <new pixel value from
calculation>
Next
This way you're only updating some byte values in memory rather than
calling GDI method's.
Am i barking up the wrong tree? Has anyone got any better solutions?
Any help would be much appreciated.
Alex
I have an app (written in .NET 2.0) which updates a picturebox
according to some user input (a slider control). when the user makes a
change i loop through all of the pixels, do a calculation and update
the picture. i currently use the GDI SetPixel method on each pixel of
the Pictureboxes image. This is proving far to slow, about 1.5 seconds
on average. This app needs to display the update as fast as possible.
Has anyone got any ideas as to how to speed this up? i was thinking
about trying to access the picturebox's memory space directly, pseudo
code:
For Each pixel in <PictureBox.Image's bytearray>
<PictureBox.Image's bytearray> (pixel) = <new pixel value from
calculation>
Next
This way you're only updating some byte values in memory rather than
calling GDI method's.
Am i barking up the wrong tree? Has anyone got any better solutions?
Any help would be much appreciated.
Alex