Insert image at after selected item no in TRichView

General TRichView support forum. Please post your questions here
Post Reply
junaid_arm
Posts: 1
Joined: Fri Jan 06, 2017 8:48 pm

Insert image at after selected item no in TRichView

Post by junaid_arm »

Hello, i have been searching around to look for a solution, there is no example of how to insert picture at a custom position in TRichview. TRichviewEdit have an insertpicture method but TRichview doesnt. Using AddPictureEX it only asks for ParaNo and not ItemNo.

Can anyone tell me how can i get around this issue?

Regards
Sergey Tkachenko
Site Admin
Posts: 17253
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

TRichView does not include methods for insertion in the specified position (the only exceptions are InsertRVFFromStream and SetListMarkerInfo).
All its methods are designed for document generation, so they add new content to the end of the document.

However, RVInsertItem.pas contains some procedures for insertion, including RVInsertGraphic:

Code: Select all

procedure RVInsertGraphic(RVData: TCustomRVData; ItemNo: Integer;
  Graphic: TGraphic; Hyperlink: Boolean; ParaNo: Integer;
  VAlign: TRVVAlign = rvvaBaseline; const Tag: TRVTag = RVEMPTYTAG);
It inserts a new image in the position ItemNo.
Example:

Code: Select all

RVInsertGraphic(RichView1.RVData, 0, MyBitmap, False, 0);
Post Reply