请问如何能在memo中显示图片? RT 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 呵呵,前两天刚在超级猛料看见过!用Memo显示图片,你可以自己改改这个控件,处理memo的 WM_Paint消息,画个图片。typeTMyMemo = class(TMemo)protectedprocedure WMPaint(var Message: TWMPaint); message WM_PAINT;end; procedure TMyMemo.WMPaint(var Message: TWMPaint);varMCanvas: TControlCanvas;DrawBounds : TRect;Begininherited;MCanvas:=TControlCanvas.Create;DrawBounds := ClientRect; // Work with temporary TRect record.TryMCanvas.Control:=Self;With MCanvas doBeginBrush.Color := clBtnFace;FrameRect( DrawBounds );InflateRect( DrawBounds, -1, -1);FrameRect( DrawBounds );FillRect ( DrawBounds );MoveTo ( 33, 0 );Brush.Color := clWhite;LineTo ( 33, ClientHeight );PaintImages;//定义的画图片过程end;finallyMCanvas.Free;End;end; procedure TMyMemo.PaintImages;varMCanvas: TControlCanvas;DrawBounds : TRect;i, j : Integer;OriginalRegion : HRGN;ControlDC : HDC;beginMCanvas:=TControlCanvas.Create;DrawBounds := ClientRect; // Work with temporary TRect record.tryMCanvas.Control:=Self;ControlDC := GetDC ( Handle );MCanvas.Draw(0, 1, Application.Icon);finallyMCanvas.Free;end;end; 用Memo显示图片,你可以自己改改这个控件,处理memo的 WM_Paint消息,画个图片。typeTMyMemo = class(TMemo)protectedprocedure WMPaint(var Message: TWMPaint); message WM_PAINT;end; procedure TMyMemo.WMPaint(var Message: TWMPaint);varMCanvas: TControlCanvas;DrawBounds : TRect;Begininherited;MCanvas:=TControlCanvas.Create;DrawBounds := ClientRect; // Work with temporary TRect record.TryMCanvas.Control:=Self;With MCanvas doBeginBrush.Color := clBtnFace;FrameRect( DrawBounds );InflateRect( DrawBounds, -1, -1);FrameRect( DrawBounds );FillRect ( DrawBounds );MoveTo ( 33, 0 );Brush.Color := clWhite;LineTo ( 33, ClientHeight );PaintImages;//定义的画图片过程end;finallyMCanvas.Free;End;end; procedure TMyMemo.PaintImages;varMCanvas: TControlCanvas;DrawBounds : TRect;i, j : Integer;OriginalRegion : HRGN;ControlDC : HDC;beginMCanvas:=TControlCanvas.Create;DrawBounds := ClientRect; // Work with temporary TRect record.tryMCanvas.Control:=Self;ControlDC := GetDC ( Handle );MCanvas.Draw(0, 1, Application.Icon);finallyMCanvas.Free;end;end; cannot perform this operation on a closed dataset问题 在线等待你的答案关于单机版的ACCESS的问题 TreeView1的onchange事件如何中断 编译时提示“[Fatal Error] Salary.dpr(9): File not found: 'crypt.dcu'”。 2个TFileStream如何同时打开同一个文件 怎样遍历一目录树并将其子目录及文件拷贝到另一地方 数据库送分? 关于ISAPI,请高手指点!!!不胜感激!!!!!! *****************怎样在局域网中 编程读取共享文件夹的文件? 如何能得到DBListBox中选择项的内容? 昨晚,我抱了我MM一下!开心呀!散分! 这条问题有一定难度,请大虾们进来看看!!!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货