Ticket Q460651
Visible to All Users

How to draw a RichEditControlt as a bitmap

created 11 years ago

Hello,
The control should provide API for taking a screen shot of itself taking into account the DPI.
We use our control in a custom DataGridView we developed which has RTF based cells. In that design when a cell is not in edit mode the rtf control is not showing. Therefore we get a image of the control's content and show that on the cell using a Graphics.DrawImage in the Cell's PaintEvent…etc…

Answers approved by DevExpress Support

created 11 years ago (modified 11 years ago)

Hi Clint,
You can use the RichEditControl.DrawToBitmap method as shown below:

C#
Bitmap someImage = new Bitmap(richEditControl1.ClientRectangle.Width, richEditControl1.ClientRectangle.Height); richEditControl1.DrawToBitmap(someImage, richEditControl1.ClientRectangle); someImage.Save("test.png");

Is this what you are looking for?

    Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

    Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.