I tried the following in the webBrowser1_Navigated handler, but the image is blank: Bitmap bitmap = new Bitmap(webBrowser1.Width, webBrowser1.Height); webBrowser1.DrawToBitmap(bitmap, new Rectangle(new Point(), webBrowser1.Size)); bitmap.Save("C:\\test.jpg", ImageFormat.Jpeg); bitmap.Dispose(); any ideas? thanx
kozu
Posts
-
How to save a webpage to a jpeg -
How to save a webpage to a jpegHi, I have a winForm that hosts a webcontrol. Is there any way I can save the page displayed by the control to jpg? thanx
-
Unreliable WebBroser controlI'm not sure what you mean. I call webControl1.Navigate("www.amazon.com"); on every button click. Sometimes it works, sometimes it doesn't.
-
Unreliable WebBroser controlHi, I host a WebBrowser control in a WinForm. When the user clicks a button I call Navigate(url) on the control, but it's not 100% reliable. Sometimes the control will navigate to the page, but sometimes it won't, for exactly the same URL. Has anyone seen something similar? thanx
-
How to disable JavaScript in webControl hosted in a WinFormCan anybody help out with this?
-
How to disable JavaScript in webControl hosted in a WinFormI tried injecting a script that would prevent the control to popup other windows, but it did not work In the webBrowser1_Navigated handler: HtmlElement head = webBrowser1.Document.GetElementsByTagName("head")[0]; HtmlElement scriptEl = webBrowser1.Document.CreateElement("script"); IHTMLScriptElement element = (IHTMLScriptElement)scriptEl.DomElement; string alertBlocker = "window.alert = function () { }"; element.text = alertBlocker; head.AppendChild(scriptEl); Also, when I right-click 'view page source' I don't see the script I injected.
-
How to disable JavaScript in webControl hosted in a WinFormHi, I have a WinForm that hosts a WebControl. Is there any way to disable all java scripts in that webControl? thanx
-
How can an AxWebBrowser notify it's host about changes on its controlsHi, I have a AxWebBrowser hosted inside a form. How can I notify the form whenever the user changes the selections in the comboBoxes hosted inside the browser? thanx
-
"File exists" errorHi, I'm getting a very weird error message whenever I try to add a Windows Form to my project. The new form is added, but when I try to add anything to it (buttons, labels) I get a "File exists" error that won't let me save. I have .Net 2008. Has anybody had a similar problem? thanx
-
Simple Regex questionI'm trying to verify if a character is a letter. Regex.IsMatch("3", "[a-zA-z]") returns TRUE when it should be FALSE. What am I doing wrong? thanx
-
AxWebBrowser questionThanx! It's official, I'm losing my mind...
-
AxWebBrowser questionHi, I need to parse the XML resulted after browsing to a url. I already have a way to do this, but I'm not quite happy with it: I have a form with an AxWebBrowser in it, I navigate the webBrowser to the url, handle webBrowser_DocumentComplete and in there grab the XML and close the form. Is there a better way of doing this without loading and hiding a form? thanx
-
Displaying context sensitive help AND scrolling the help file to a topicHi, I need to display CSH from my app. I call Help.ShowHelp(this, "myHelpFile.chm", HelpNavigator.Topic, "secondTopic.htm"); and it works fine, but I can't get the help file to expand the nodes and scroll to that specific topic. All it does is displays the topic, but the table of contents stays collapsed. Is there any way of doing this? I'm using .Net 1.1 thanx
-
Getting midnight out of a calendar controlHi, I need to get a date out of a calendar control (set the CustomFormat to MM/dd/yy hh:mm tt), but when I call Convert.ToDateTime(dtpOrdStart.Value).ToString() I get the date and a random timestamp. Is there any way I can force it to 12:00:00 AM without having to go into the string and replace it myself? thanx
-
Component1 vs Infragistics vs SyncfusionHmm.. DevExpress wasn't on my list, but I'll sure take a look, now that you brought it up! Could you tell me what controls did you find buggy in Syncfusion? thanx
-
Component1 vs Infragistics vs SyncfusionHi, Has anybody done a comparison between these 3 component suites? I need to pick one to integrate in my Windows-based app (the app has UI galore). After a quick glance, C1 doesn't seem very structured (has a lot of do-it-all components - the FlexGrid can also do Trees), whereas Infragistics and Syncfusion seem better layed out (I really like Syncfusion's docking manager). Most likely I'll have to write small apps with each suite to figure out if they have what I need (for example listView drag'n drop is a big one, because now I'm using XCeed and their drag'n drop is a joke), but I thought I'd ask others what's their take on this (speed, feature set, memory footprint, stuff like that). If you haven't compared them, but are currently using one of them, please tell me what you think of it. thanx
-
.Net 1.0 & 2.0 on the same machineWould it be a problem if I installed .Net 1.0 and 2.0 on the same machine? thanx
-
Drag'n Drop from ListViewControlHi, I'm trying to implement a drag'n drop from a multiselect listView to a tree. The code is as follows: private void listView1_ItemDrag(object sender, System.Windows.Forms.ItemDragEventArgs e) { listView1.DoDragDrop(listView1.SelectedItems, DragDropEffects.Copy); } private void treeView1_DragEnter(object sender, System.Windows.Forms.DragEventArgs e) { if (e.Data.GetDataPresent(typeof(ListView.SelectedListViewItemCollection))) e.Effect = DragDropEffects.Copy; } private void treeView1_DragDrop(object sender, System.Windows.Forms.DragEventArgs e) { //do something here } Everything is fine, except that a lot of times the list thinks I'm trying to select items instead of initiating a drag'n drop. Is there a listView setting I'm missing somehow? thanx
-
Automatically generate Release Notes from codeHmm.. this will report the files with a certain label, but not what's in the text node of that label. But I could make this so it generates a file, and write a small program that parses each reported file and builds HTML from the tags. Thanx!
-
Automatically generate Release Notes from codeFor SS I use Visual SourceSafe. Is there a way to generate the notes from VSS? If not, is there another tool for this? thanx