当尝试使用Chrome控制器为chrome执行网页C#代码时,我作为屏幕截图得到的是IE而不是Chrome呈现的网页(我试图捕捉的站点由Chrome、FireFox和IE呈现不同)。
你能给我解释一下如何为Chrome而不是IE呈现的网页制作截图吗?Ps:我以前使用过ChromeDriver,但是它只捕获了网页的可见部分,非常感谢。
这是获取网页屏幕截图的方法。
`public static void TakeScreenShotChrome(WebBrowser WB, string url, string path)
// Load the webpage into a W
我试图找出在wxpython中添加GenStaticBitmap的textctrl/combobox顶部是否可行。
在我的快速搜索中没有找到任何东西。这不是第一优先,但我觉得这将使程序的使用更好。
在这种情况下,我有截图从网页和用户可以选择输入框,它应该是textctrl在位图上的位置,它被选中。(我已经把textctrl定位在其他地方了)。
# example something like this
self.staticbitmap = GenStaticBitmap(self.panel, self.bitmap)
text = wx.textctrl(self.panel)
# Hav
如何在给定URL作为输入的情况下以编程方式获取网页的截图?
这是我到目前为止所拥有的:
// The size of the browser window when we want to take the screenshot (and the size of the resulting bitmap)
Bitmap bitmap = new Bitmap(1024, 768);
Rectangle bitmapRect = new Rectangle(0, 0, 1024, 768);
// This is a method of the WebBrowser control, and th
我尝试在ASP WebBrowser应用程序中使用.NET控件:
public BrowserForm()
{
webBrowser1 = new WebBrowser();
webBrowser1.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(webBrowser1_DocumentCompleted);
}
private void webBrowser1_DocumentCompleted(Object sender, Web
我有一个在wp7中截图的代码。
int Width = (int)LayoutRoot.RenderSize.Width;
int Height = (int)LayoutRoot.RenderSize.Height;
// Write the map control to a WwriteableBitmap
WriteableBitmap screenshot = new WriteableBitmap(LayoutRoot, new TranslateTransform());
using (MemoryStream ms = new MemoryStream())
{
//
我从下面的链接中获取了一些代码,以便从web浏览器控件生成屏幕截图:
然后,我将其修改为扩展方法,如下所示:
public static Bitmap GetScreenshot(this WebBrowser webBrowser)
{
// Load the webpage into a WebBrowser control
using (WebBrowser wb = new WebBrowser())
{
wb.ScrollBarsEnabled = false;