I have a application that will capture the screen and I want to write the captured information to an array, this takes AGES as the array ends up being +2million values. I am iterating and adding the values to the array, is there any way quicker (eg binary operations)? Should it be this slow? Why is it?
            Asked
            
        
        
            Active
            
        
            Viewed 128 times
        
    2 Answers
1
            
            
        Assuming your GetPixel'ing the screen pixel by pixel, its the GetPixel call that's slow (it interrogates the display driver) not the (pre-dimensioned) array assignment.
You can instead use the getdibits() api which will copy the DC's colour info into a buffer in a single call.
Here is a C++ example, but the methodology & call sequence is the same as for VB.
1
            Figured out why it was so slow, it was because I was using ReDim on every iteration of the loop - thanks for the help anyways
Martin
        marscom
        
- 615
 - 2
 - 11
 - 24