We help IT Professionals succeed at work.

richedit with background picture?

zastava101
zastava101 asked
on
how to put background to trichedit component?

thanks in advance
Comment
Watch Question

Commented:
Go to http://www.lmc-mediaagentur.de/dpool.htm
Select SEARCH and then TIPS ONLY .
Type in search combo 'richedit' and the read the first tip.
Commented:
procedure TForm1.Button2Click(Sender: TObject);
var
  imagecanvas: TCanvas;
  fmt: TFormatRange;
begin
  imagecanvas := image1.canvas;
  with fmt do begin
    hdc:= imagecanvas.handle;
    hdcTarget:= hdc;
    // rect needs to be specified in twips (1/1440 inch) as unit
    rc:=  Rect( 0, 0,
                imagecanvas.cliprect.right * 1440 div pixelsperinch,
                imagecanvas.cliprect.bottom * 1440 div pixelsperinch
                );
    rcPage:= rc;
    chrg.cpMin := 0;
    chrg.cpMax := richedit1.GetTextLen;
  end;
  SetBkMode( imagecanvas.Handle, TRANSPARENT );
  richedit1.perform( EM_FORMATRANGE, 1, integer( @fmt ));
  // next call frees some cached data
  richedit1.perform( EM_FORMATRANGE, 0, 0 );
  image1.refresh;
  // refresh is necessary since the control only refreshes automatically  
  // if a canvas method is used to change its content.
 
end;

This assumes TImage contains a bitmap image. Add the richedit unit to your Uses clause (the one after the Implementation keyword).
ADMINISTRATION WILL BE CONTACTING YOU SHORTLY.  Moderators Computer101 or Netminder will return to finalize these if still open in seven days.  Please post closing recommendations before that time.

Question(s) below appears to have been abandoned. Your options are:
 
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you. You must tell the participants why you wish to do this, and allow for Expert response.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question. Again, please comment to advise the other participants why you wish to do this.

For special handling needs, please post a zero point question in the link below and include the question QID/link(s) that it regards.
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
 
Please click the Help Desk link on the left for Member Guidelines, Member Agreement and the Question/Answer process.  http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

Please click you Member Profile to view your question history and keep them all current with updates as the collaboration effort continues, to track all your open and locked questions at this site.  If you are an EE Pro user, use the Power Search option to find them.

To view your open questions, please click the following link(s) and keep them all current with updates.
http://www.experts-exchange.com/questions/Q.20001252.html
http://www.experts-exchange.com/questions/Q.20026086.html
http://www.experts-exchange.com/questions/Q.20066091.html
http://www.experts-exchange.com/questions/Q.20070791.html
http://www.experts-exchange.com/questions/Q.20070795.html
http://www.experts-exchange.com/questions/Q.20081086.html
http://www.experts-exchange.com/questions/Q.20081708.html
http://www.experts-exchange.com/questions/Q.20082186.html
http://www.experts-exchange.com/questions/Q.20087813.html
http://www.experts-exchange.com/questions/Q.20094507.html
http://www.experts-exchange.com/questions/Q.20103740.html
http://www.experts-exchange.com/questions/Q.20104227.html
http://www.experts-exchange.com/questions/Q.20108539.html
http://www.experts-exchange.com/questions/Q.20112131.html
http://www.experts-exchange.com/questions/Q.20118798.html
http://www.experts-exchange.com/questions/Q.20141336.html
http://www.experts-exchange.com/questions/Q.20157666.html
http://www.experts-exchange.com/questions/Q.20159442.html
http://www.experts-exchange.com/questions/Q.20177987.html
http://www.experts-exchange.com/questions/Q.20182504.html
http://www.experts-exchange.com/questions/Q.20193634.html
http://www.experts-exchange.com/questions/Q.20194167.html
http://www.experts-exchange.com/questions/Q.20090036.html
http://www.experts-exchange.com/questions/Q.20265702.html


To view your locked questions, please click the following link(s) and evaluate the proposed answer.
http://www.experts-exchange.com/questions/Q.20002824.html
http://www.experts-exchange.com/questions/Q.20179302.html
http://www.experts-exchange.com/questions/Q.20182632.html

PLEASE DO NOT AWARD THE POINTS TO ME.  
 
------------>  EXPERTS:  Please leave any comments regarding your closing recommendations if this item remains inactive another seven (7) days.  Also, if you are interested in the cleanup effort, please click this link http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=commspt&qid=20274643
 
Thank you everyone.
 
Moondancer
Moderator @ Experts Exchange

P.S.  For any year 2000 questions, special attention is needed to ensure the first correct response is awarded, since they are not in the comment date order, but rather in Member ID order.
Ignored/finalized.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.