JVCL Help:TJvCustomRichEdit.InsertGraphic

From Project JEDI Wiki
Jump to navigationJump to search
JEDI Visual Component Library Help

Search in JVCL Help

 
Search in all projects
 

Summary

Inserts a graphic at the current cursor position.


Pascal

 procedureInsertGraphic(AGraphic: TGraphic; constSizeable: Boolean);


Parameters

Parameters Description
AGraphic: TGraphic Specifies the graphic to insert.
const Sizeable: Boolean Specifies whether the graphic can be resized by the user.


Description

Call InsertGraphic to insert a graphic at the current cursor position.
If parameter Sizeable is set to false, but property OLEDragDrop is true, then the user can drag and drop the image, and then resize the image. Set OLEDragDrop to false to completely prevent the user from resizing the image. Another way is to set ReadOnly to true.
Code example: procedure AddImageToRichEdit(AImageList: TImageList; const AImageIndex: Integer);
var

 Bitmap: TBitmap;
begin
Bitmap := TBitmap.Create;
try
AImageList.GetBitmap(AImageIndex, Bitmap);
JvRichEdit1.InsertGraphic(Bitmap, False);


   { Move cursor }
with JvRichEdit1.GetSelection do
JvRichEdit1.SetSelection(cpMin + 1, cpMin + 1, False);
finally
Bitmap.Free;
end;
end;


See Also

BitmapToRTF, BitmapToRTF2, TJvCustomRichEdit.InsertFormatText


About

Notes

InsertGraphic is slower than BitmapToRTF and BitmapToRTF2, but only with InsertGraphic you can stream out RTF content that includes the inserted graphics.


Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page