Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
Sorry... I don't see the utility of this....

"If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown

"Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me

"A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend.

C# TO VB TRANSLATOR

Posted

I want to be able to wrap this functionality into a web service.

 

You could then use it as part of a web search where alongside each search result you could show a thumbnail image of the web page.

Posted

Screenshot maybe ?

 

I want to be able to wrap this functionality into a web service.

 

You could then use it as part of a web search where alongside each search result you could show a thumbnail image of the web page.

So... you could take a screen shot of your browser in maximize mode dynamicly and transfer it to a Bitmap object and resize it to the right size and save it as a file.

 

(For the screen shot... you can see it how it's done here.)

 

Good day ! :D

"If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown

"Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me

"A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend.

C# TO VB TRANSLATOR

Posted
I don't know what steps you would take to do all of this in .NET, but I know that PDF's can be converted to BMP. So, if you printed the web page to a PDF file and then converted it to BMP..... Or, maybe there is a way (perhaps someone has already created a component for this) to print directly to a BMP file. That way you could get the whole page instead of just the portion on the screen.
  • 4 years later...
Posted

Dear naeem_s !

 

I hope my code can help you :o :

 

 

Private Sub Capture_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Capture.Click

Dim w As New WebBrowser()

w.Size = New Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height)

w.Navigate("http://www.google.com.vn")

AddHandler w.DocumentCompleted, AddressOf CompletedDoc

End Sub

 

Private Sub CompletedDoc(ByVal sender As Object, ByVal e As WebBrowserDocumentCompletedEventArgs)

Dim w As WebBrowser = CType(sender, WebBrowser)

Dim b As New Bitmap(w.Document.Body.ScrollRectangle.Width, w.Document.Body.ScrollRectangle.Height)

w.DrawToBitmap(b, New Rectangle(0, 0, b.Width, b.Height))

b.Save("Your Image File Path Here", Drawing.Imaging.ImageFormat.Jpeg)

b.Dispose()

w.Dispose()

End Sub

 

 

Note: the DrawToBitmap method isn't show on context menu, but you still use it :D .

 

Everything will be OK.

  • 1 year later...
Guest Farhomar
Posted

I use WebsitesScreenshot .NET library in all my projects which require html to image conversion or web page screenshot.

http://www.websitesscreenshot.com/

WebsitesScreenshot.WebsitesScreenshot _Obj;

_Obj = new WebsitesScreenshot.WebsitesScreenshot();

WebsitesScreenshot.WebsitesScreenshot.Result _Result;

_Result = _Obj.CaptureWebpage("http://www.msn.com");

if (_Result == WebsitesScreenshot.

WebsitesScreenshot.Result.Captured)

{

_Obj.ImageWidth = 200;

_Obj.ImageHeight = 300;

_Obj.ImageFormat = WebsitesScreenshot.

WebsitesScreenshot.ImageFormats.PNG;

_Obj.SaveImage("c:\\msn.png");

}

_Obj.Dispose();

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...