lockbuffer backbuffer()
For x = 0 to GraphicsWidth()
For Y = 0 to GraphicsHeight()
thisPixel = ReadPixelFast(x,y,backbuffer())
next
next
unlockbuffer backbuffer()
For x = 0 to GraphicsWidth()
For Y = 0 to GraphicsHeight()
thisPixel = ReadPixelFast(x,y,backbuffer())
next
next
unlockbuffer backbuffer()
For one thing, you are calling the GraphicsHeight() function every loop of your x loop (which would be 320 times). What a waste of processiing time. You only need to find out the width of the screen once. It certainly would be a lot faster to just call it one time before your loop and save it to a variable. Your code would look something like:
lockbuffer backbuffer() height = GraphicsHeight() - 1 For x = 0 to GraphicsWidth() - 1 For Y = 0 to height thisPixel = ReadPixelFast(x,y,backbuffer()) next next unlockbuffer backbuffer()
And that's about as fast as ReadPixelFast is going to get. Reads from the graphic card are pathetically slow, but writes are extremely fast. So, if you can store the image in a bank or array (or even another imagebuffer as long as you aren't doing any Read-ing) and then copy it to the backbuffer() with your changes, you will see a huge performance increase.