这个太简单,用draw,但是文字会覆盖,但是重新刷新会闪烁,这也是控件自身的不足
procedure TForm1.Button1Click(Sender: TObject);
var
MyCanvas: TControlCanvas;
Begin
MyCanvas:=TControlCanvas.Create;
Mycanvas.control:=RichEdit1;//想在RichEdit1上作画
With Mycanvas do
Begin
//这里可以更改为你的作图程序
Draw(0,0,image1.Picture.Graphic);
Font.Color := clRed;
Brush.Style := bsClear;
TextOut(10,10,'在RichEdit中显示图片');
end;
End;
procedure TForm1.RichEdit1KeyUp(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
RichEdit1.Brush.Style := bsClear;
end;