def ToFile(self, savePath: str) -> bool:
name, ext = os.path.splitext(savePath)<EOL>extMap = {'<STR_LIT>': '<STR_LIT>'<EOL>, '<STR_LIT>': '<STR_LIT>'<EOL>, '<STR_LIT>': '<STR_LIT>'<EOL>, '<STR_LIT>': '<STR_LIT>'<EOL>, '<STR_LIT>': '<STR_LIT>'<EOL>, '<STR_LIT>': '<STR_LIT>'<EOL>, '<STR_LIT>': '<STR_LIT>'<EOL>}<EOL>gdiplusImageFormat = extMap.get(ext.lower(), '<STR_LIT>')<EOL>return bool(_DllClient.instance().dll.BitmapToFile(self._bitmap, ctypes.c_wchar_p(savePath), ctypes.c_wchar_p(gdiplusImageFormat)))<EOL>
Save to a file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
Return bool, True if succeed otherwise False.