473,387 Members | 1,771 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

DrawToBitmap C# problem

Hi, im having a problem with drawtobitmap in C# when i call the method its not printing the contents of a control. in my case richtext format, my code is below;
Bitmap bi = new Bitmap(this.rtfbody.Width + 200, this.rtfbody.Width + 200);
bi.SetResolution(3000, 3000);

// rf = rtfbody.CreateControl();
rtfbody.CreateControl();
rtfbody.DrawToBitmap(bi, new Rectangle(0, 0, rtfbody.Width + 200, rtfbody.Height + 200));
bi.Save(@"c:\abc.bmp"); //, PixelFormat.Format24bppRgb);
Jun 27 '08 #1
1 6033
On Thu, 22 May 2008 03:30:48 -0700, omlac <omlacwrote:
Hi, im having a problem with drawtobitmap in C# when i call the method
its not printing the contents of a control. in my case richtext format,
What is "rtfbody"? Is it visible on the screen? If I recall correctly,
DrawToBitmap() only draws what you'd see on the screen.

I think you're going to have to use WM_PRINT via p/invoke to get what you
want. I haven't found a reliable .NET way to get a control to draw its
entire self into a bitmap.

Pete
Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

117
by: Peter Olcott | last post by:
www.halting-problem.com
28
by: Jon Davis | last post by:
If I have a class with a virtual method, and a child class that overrides the virtual method, and then I create an instance of the child class AS A base class... BaseClass bc = new ChildClass();...
1
by: Danny Tuppeny | last post by:
The MSDN page for this method reads: --------- Quote --------- WebBrowserBase.DrawToBitmap Method Note: This method is new in the .NET Framework version 2.0. This method supports the .NET...
6
by: powella | last post by:
Hello All, I've recently discovered the DrawToBitmap method hidden away in the Control class (in .NET 2.0). What a fantastic addition to the class. I'm having some degree of difficulty using...
1
by: GM | last post by:
Hello, I have visual studio 2005 on XP SP2. I have a simple sample application using a webbrowser and 2 buttons. Button1 loads the page Button2 saves the screenshot But for some reason the...
0
by: Prosperz | last post by:
Hi, I would like if there is a way to use DrawToBitmap with a WebBrowser control in Framework 2.0. In MSDN I found this method is not implemented for this control. Thanks.
2
by: NickP | last post by:
Hi there, I have a form with a few controls on, some of them are controls I have made. Anyway, when I call DrawToBitmap on the form all looks fine except for the controls I have made, they have...
0
by: Joey | last post by:
I want to use DrawToBitmap to generate a "thumbnail" graphic reflecting a particular web page. The following code successfully generates a graphic of the web page being viewed in the WebBrowser...
0
by: RedLars | last post by:
Though I'd start of this post with a some background information. In an application we are developing we needed a treeview that could check, uncheck and disable individual nodes. This was not...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.