Description


Adds a picture to the end of document.



procedure AddPicture (const Name: String; gr: TGraphic; ParaNo: Integer = -1; VAlign: TRVVAlign = rvvaBaseline);

 Parameter

 Description

 Name

 Name of this picture item, any string. Name must not contain CR and LF characters. RichEdit does not use item names itself, they are for your own use.

 gr

 Picture to insert. By default, this picture will be owned by RichEdit component, and you must not free it.

 ParaNo

 Optional parameter. If ParaNo=-1, the method adds an item to the end of the last paragraph. If ParaNo>=0, this item starts a new paragraph.

 VAlign

 Optional parameter. Vertical align of this picture, relative to its line, available values: rvvaBaseline, rvvaMiddle, rvvaAbsTop, rvvaAbsBottom, rvvaAbsMiddle, rvvaLeft, rvvaRight



Example


procedure Form1_Button1_OnClick (Sender: TObject; var Cancel: boolean);
var
   Graphic: TGraphic;
begin
   Graphic := TJpegImage.Create;
   Graphic.LoadFromFile('d:\filename.jpg');
   Form1.RichEdit1.AddPicture('', Graphic);
   Form1.RichEdit1.Format;
end;