Questions tagged [drawtobitmap]

31 questions
16
votes
4 answers

Converting WebBrowser.Document To A Bitmap?

Is it possible to draw a WebBrowser.Document to a Bitmap? Basically taking a screenshot of a WebBrowser control (note, this is with a WebBrowser that doesn't live on a form, but just in code). WebBrowser w = new WebBrowser(); w.Document =…
sooprise
  • 22,657
  • 67
  • 188
  • 276
11
votes
2 answers

DrawToBitmap not taking screenshots of all items

I currently have this useful code that I found elsewhere on StackOverflow: form.DrawToBitmap(bmp, new Rectangle(0, 0, bmp.Width, bmp.Height)); I have a form with a few text boxes/drop downs and a large picture box. I then have smaller picture boxes…
Mike91
  • 520
  • 2
  • 9
  • 25
9
votes
3 answers

WebBrowser.DrawtoBitmap() generating blank images for few sites consistently

I've been using WebBrowser.DrawtoBitmap() in my asp.net page running in separate STA thread to capture web pages as an image. But I found that I'm getting blank images for few sites consistently. I'm aware that the method is not 'officially'…
NLV
  • 21,141
  • 40
  • 118
  • 183
3
votes
1 answer

C# - take picture from inside of a form

OK, I know how DrawToBitmap works or the CopyToScreen methods and all. What I'm looking for is how to take a picture from inside a form (without the form borders, title and maximize box and all) I tried different things for the Rectangle parameter…
Auxiliary
  • 2,687
  • 5
  • 37
  • 59
3
votes
6 answers

richTextBox.DrawToBitmap Does Not Draw Containing Text?

If I have a richTextBox and run DrawToBitmap on it, it doesn't draw any of the text inside of the richTextBox. Bitmap b = new Bitmap(rtb.Width, rtb.Height); inputControl.DrawToBitmap(b, new Rectangle(0, 0, b.Width, b.Height)); Is there any way to…
sooprise
  • 22,657
  • 67
  • 188
  • 276
3
votes
1 answer

WebBrowser Madness

Edit: The original question was a long one with many wild guesses. I have cut it back to the remaining mysteries.. I've been struggling and puzzling all day now and guess I ought to present my problem to the community. It originated from the post…
TaW
  • 53,122
  • 8
  • 69
  • 111
3
votes
2 answers

How can I get a screenshot of control? DrawToBitmap not working

I have a pictureBox that's being painted to externally via a dll call. private void myPictureBox_Paint(object sender, PaintEventArgs e) { dllClass.RefreshEx(LWHANDLE, 0, 0); } This is working and all, but I now need to get a screenshot of…
David
  • 15,652
  • 26
  • 115
  • 156
2
votes
1 answer

DataGridView - get actual column widths

I am developing an ASP.NET website in which I have some tables of data. I want to generate images of this data, so that I can display those images on forums (for example). The method I have used in the past is quite simple: I create a…
Nick Thissen
  • 1,802
  • 4
  • 27
  • 38
2
votes
1 answer

control.DrawToBitmap() not working as expected

in Winform application, i have a user control; on which shapes like rectangle,circle etc. are drawn. i am trying to take snapshot of the same by using DrawToBitmap() method. i have a Bitmap of fixed size(300 x 300) and user control is of size (600…
Iorn Man
  • 267
  • 8
  • 21
1
vote
2 answers

Drawing a WebBrowser control to a bitmap

I'm trying to save a panel control as a bitmap using the following code (VB.net): Private Sub SaveFileDialog1_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles SaveFileDialog1.FileOk filename =…
Derek
  • 799
  • 2
  • 8
  • 17
1
vote
2 answers

C# Screenshot of Control is white

My question is related to this one: How to get a screen capture of a .Net WinForms control programmatically? I want to take a screenshot of a System.Windows.Forms.Control in C#. I'm using the DrawToBitmap method suggested in the question linked…
user968698
  • 429
  • 3
  • 14
1
vote
3 answers

How to use Control.DrawToBitmap to render a Form into a Bitmap without its decorations (titlebar, border)?

I have a Form and in it an Overlay control (transparent gray backcolor with White text over "Drop here..." and an icon) that is visible only when a file is dragged over the Form. The Overlay is made transparent by drawing the control in its back on…
silviubogan
  • 3,343
  • 3
  • 31
  • 57
1
vote
1 answer

DrawToBitmap returning blank image

I have a problem on creating bitmap image out of my winform application. Situation: I have a UserControl named as "CanvasControl" that accepts OnPaint method acting as canvas for my Draw Pad application. Inside this user control I have a function…
G. Pacete
  • 76
  • 1
  • 12
1
vote
1 answer

c# winform DrawToBitmap offscreen

Is there any way to screen grab a windows form control if it's bigger than your monitor? For example, my winform is 3000px by 3000px Monitor is 1080p this.Height = 3000; this.Width = 3000; Graphics g =…
Watson
  • 1,385
  • 1
  • 15
  • 36
1
vote
0 answers

using DrawtoBitmap with overlapping controls and shapes

I'm trying to make repeated screenshots from one of my forms (i.e load the form with specific data, take and save the screenshot, then load the form with different data, take another screenshot, and so on). The form contains overlapping Shape and…
Peter_Pe
  • 13
  • 4
1
2 3