--- Quote Start ---
My frame size is 320x240.
I have Altera UP IP cores with streaming protocol. I inserted one line buffer(size 320)in between by building a custom component.
So, every pixel passes through the line buffer. Now, when i want to click the image, I will be storing the next 320x240 pixels coming to my line buffer.
Please correct me if I am wrong.
Now, when I press the button to click, the current pixels in the line buffer could be any, throughout the image. So while storing the next pixels, I need to know the their locations so that while displaying them back, I can give it to appropriate location in pixel buffer memory.
--- Quote End ---
I am not familiar with "Altera UP IP cores with streaming protocol" so this is a general reply.
You need to maintain some state and track the synchronization events. Your button press should signal a "frame save is pending" and then when the next frame sync comes around, you examine that flag and possibly start saving the frame: start writing at a given base address in RAM at offset 0, and keep incrementing the offset with every pixel that you write.