rvico TRichView Reference | TRichView

TCustomRichView.AddPictureEx, AddPictureExTag

TCustomRichView.AddPicture (deprecated)

Top  Previous  Next

These methods add picture (gr) with the specified Name and vertical alignment (VAlign) to the end of document

procedure AddPictureExTag(const Name: String; gr: TGraphic;
  ParaNo: Integer; VAlign: TRVVAlign; Tag: Integer);

procedure AddPictureEx(const Name: String; gr: TGraphic;
  ParaNo: Integer; VAlign: TRVVAlign);

procedure AddPicture(gr: TGraphic); deprecated;

AddPictureEx provides a subset of functionality of AddPictureExTag:

AddPictureEx(...) is equivalent to AddPictureExTag(..., 0).

The same as AddHotPicture and AddHotPictureTag, but this picture will not be a hypertext link.

AddPicture is deprecated and maintained for backward compatibility (with TRichView versions prior to 1.0):

AddPicture(gr) is equivalent to AddPictureEx('', gr, 1, rvvaBaseline).

 

Parameters:

Name – name of this picture item, any string. Name must not contain CR and LF characters. RichView does not use Names itself, they are for you own use. This is an ANSI string, regardless of Unicode mode of text styles.

gr – picture to insert.

VAlign – vertical align of this picture, relative to its line, see TRVVAlign for possible values.

If ParaNo=-1, the methods add the item to the end of the last paragraph. If ParaNo>=0, this item starts a new paragraph with the ParaNo-th style. (ParaNo is an index in the ParaStyles collection of the linked RVStyle component). It defines attributes for the new paragraph.

Tagtag of this picture item.

 

Alternatives:

If you want to add a TGraphic picture-hyperlink, add a hot picture instead.
If you want to add a hyperlink-picture from image list, add a hotspot instead.
If you want to add a simple (not a hyperlink) picture from image list, add a bullet instead.

 

Methods type: viewerstyle viewer-style.

Example:

procedure AddBitmapFromFile(rv: TCustomRichView; 

  const FileName: String; ParaNo: Integer);

var bmp: TBitmap;

begin

  bmp := TBitmap.Create;

  bmp.LoadFromFile(FileName);

  rv.AddPictureEx('', bmp, ParaNo, rvvaBaseline);

end;

...

// creating document with 2 pictures

// in the same paragraph

rv.Clear;

AddBitmapFromFile(rv, 'd:\pic1.bmp'0);

AddBitmapFromFile(rv, 'd:\pic2.bmp', -1);

rv.Format;

See also methods:

Format;
FormatTail;
SetAddParagraphMode.

See also methods of TRichViewEdit:

InsertPicture.

See also properties of TRVStyle:

ParaStyles.

See also:

Item types;
Other methods for appending items;
"Tags".


RichView © Sergey Tkachenko