给你一段代码,可以放到插入图片的过程中。
var
Picture: TPicture;
OpenPictureDialog: TOpenPictureDialog;
begin
OpenPictureDialog := TOpenPictureDialog.Create(nil);
try
OpenPictureDialog.Filter := Format('%s|%s|%s', [GraphicFilter(TBitmap),
GraphicFilter(TMetafile),GraphicFilter(TJPEGImage)]);//设置有Jpeg文件
if OpenPictureDialog.Execute then
begin
Picture := TPicture.Create;
try
Picture.LoadFromFile(OpenPictureDialog.FileName);
Clipboard.Assign(Picture);
RichEdit.PasteFromClipboard;
finally
Picture.Free;
end;
end;
finally
OpenPictureDialog.Free;
end;
end;
别忘了在uses中加入ClipBrd