Try another attempt for reading framebuffer to memory and code cleanup
Merge pull request #3877 from raven02/patch-1

Try another attempt for reading framebuffer to memory and code cleanup