fix bugs that cannot capture image in windows.