从Microsoft Spotlight项目提取图像(仅限Windows X)
spotlightp的Python项目详细描述
简介
现在,请按住Windows 10聚光灯项目下显示的漂亮的锁屏墙纸。使用此工具可以将缓存的图像存储在指定的文件夹中,或者获取它们的pil.image.image对象以您喜欢的方式对其进行变换。
安装
使用安装
pip install spotlightpy
用法
必须使用Windows X操作系统才能执行此模块。 所有方法都位于spotlightpy的spotlight子模块中。首先,导入spotlight
>>> from spotlightpy import spotlight
聚光灯模块有两种方法。
获取图像:
getimages(None) –: List(PIL.Image.Image)
this method returns a list of PIL.Image.Image objects of the cached images with each object representing a spotlight image of resolution 1920*1080.
>>> spotlight.getimages() [<PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=1920x1080 at 0x34305F0>, <PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=1920x1080 at 0x3430F70>, <PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=1920x1080 at 0x1518030>, ...]
- 存储图像(destination_path=“c:\ spotlight”)
> p>将聚光映像从PC存储到参数指定的路径中。如果没有提供路径,则在“C:\聚光灯”下构造一个新文件夹,并将图像存储在那里。如果给定的参数不代表任何现有文件夹,则创建一个新文件夹来存储图像。如果给定的字符串不符合有效路径即使新的文件夹或文件已经存在相同的绝对路径,则“ValueError”将被引发。 >>> spotlight.storeimages("C:\\MySpotlightImages")