Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to copy text from a TRichEdit to the canvas of a TImage Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
29-Aug-02
Category
Reporting /Printing
Language
Delphi 2.x
Views
70
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Tomas Rutkauskas

How to copy text from a TRichEdit to the canvas of a TImage

Answer:

1   uses
2     Richedit;
3   
4   var
5     imagecanvas: TCanvas;
6     fmt: TFormatRange;
7   begin
8     imagecanvas := image1.canvas;
9     with fmt do
10    begin
11      hdc := imagecanvas.handle;
12      hdcTarget := hdc;
13      rc := Rect(0, 0, imagecanvas.cliprect.right * 1440 div pixelsperinch,
14        imagecanvas.cliprect.bottom * 1440 div pixelsperinch);
15      rcPage := rc;
16      chrg.cpMin := 0;
17      chrg.cpMax := richedit1.GetTextLen;
18    end;
19    {  SetBkMode( imagecanvas.Handle, TRANSPARENT );  }
20    richedit1.perform(EM_FORMATRANGE, 1, integer(@fmt));
21    richedit1.perform(EM_FORMATRANGE, 0, 0);
22    image1.refresh;
23  end;


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC