问题描述
我如何使用imagegrabscreen来获取缩略图和特定网站的完整尺寸图片。
How could I use imagegrabscreen to get a thumbnail image and a full size image of a specific website.
我原以为我可以 array
我把想要的uri送进去但是我有点卡在我如何设置我需要抓取的图像的wxh上。我还认为我需要缩略图类
和 fullimage类
并在需要时调用它们。
I was thinking that I could have an array
that I feed the wanted uri's into but I am a bit stuck on how I would set the wxh of the image I need to grab. I also think that I would need a thumbnail class
and a fullimage class
and call them when required.
任何更好的想法?
推荐答案
请记住,imagaegrabscreen仅限Windows。如果您设置了多个显示器,此功能将仅获取主显示器。此外,要使其工作,您的Apache服务必须设置为允许服务与桌面交互
否则您将获得一个空白图像。
Keep in mind that imagaegrabscreen is Windows-only. If you have multiple displays set up, this function will only grab the primary display. Also, for this to work, your Apache service must be set to Allow service to interact with desktop
otherwise you will just get a blank image.
这个讨论很好地涵盖了 imagegrabscreen
的使用:
This discussion covers the use of imagegrabscreen
pretty well: Getting imagegrabscreen to work
关于将网页保存为图像还有很多其他讨论 - 以下是一些:
There are a lot of other discussions about saving webpages as images, too - here are a few:
- Website screenshots using PHP
- Web Page Screenshots with PHP?
- How can I generate a screenshot of a webpage using a server-side script?
- PHP: How to capture browser window screen with php?
- https://stackoverflow.com/questions/1340917
- What is the best way to create a web page thumbnail?
- Screenshot of current page using PHP
- shell tool which renders web site including javascript
- In any languages, Can I capture a webpage and save it image file? (no install, no activeX)
这篇关于PHP使用imagegrabscreen的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!