Repaint before reading pixels.