是否能用memo来显示图象?

icandoit 2001-02-14 10:55:00
加精
...全文
191 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
Kingron 2001-02-17
  • 打赏
  • 举报
回复
2 Manwill(风玉树) :
tmemo有canvas属性吗?
Manwill 2001-02-17
  • 打赏
  • 举报
回复
在memo上动态生成一个Image就可以了。或者在Memo上
Meme.Canvas.draw(。。。。)把
jingpingyi 2001-02-15
  • 打赏
  • 举报
回复
应该不能。
Memo用于处理文本的。
Nicrosoft 2001-02-15
  • 打赏
  • 举报
回复
当然可以,只要是windows的窗口(memo也是windows窗口),就可以画图。
bill_lasker 2001-02-15
  • 打赏
  • 举报
回复
自画还差不多。
laza 2001-02-15
  • 打赏
  • 举报
回复
用Memo显示图片,你可以自己改改这个控件,处理memo的 WM_Paint消息,画个图片。

type
TMyMemo = class(TMemo)
protected
procedure WMPaint(var Message: TWMPaint); message WM_PAINT;
end;


procedure TMyMemo.WMPaint(var Message: TWMPaint);
var
MCanvas: TControlCanvas;
DrawBounds : TRect;
Begin
inherited;
MCanvas:=TControlCanvas.Create;
DrawBounds := ClientRect; // Work with temporary TRect record.
Try
MCanvas.Control:=Self;
With MCanvas do
Begin
Brush.Color := clBtnFace;
FrameRect( DrawBounds );
InflateRect( DrawBounds, -1, -1);
FrameRect( DrawBounds );
FillRect ( DrawBounds );
MoveTo ( 33, 0 );
Brush.Color := clWhite;
LineTo ( 33, ClientHeight );
PaintImages;//定义的画图片过程
end;
finally
MCanvas.Free;
End;
end;



procedure TMyMemo.PaintImages;
var
MCanvas: TControlCanvas;
DrawBounds : TRect;
i, j : Integer;
OriginalRegion : HRGN;
ControlDC : HDC;
begin
MCanvas:=TControlCanvas.Create;
DrawBounds := ClientRect; // Work with temporary TRect record.
try
MCanvas.Control:=Self;
ControlDC := GetDC ( Handle );
MCanvas.Draw(0, 1, Application.Icon);
finally
MCanvas.Free;
end;
end;


GoodHope 2001-02-15
  • 打赏
  • 举报
回复
肯定不能。
sundayboys 2001-02-14
  • 打赏
  • 举报
回复
呵呵,你还是下载一个RichEdit增强控件吧,CSDN上就有。

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧