高手请进,不是高手就不要进来了。 一个问题难住我两三天了:FORM上有一个OLE控件,连接是新建一个画笔图片。程序运行时双击鼠标编辑它,然后想把画出来的东西存成一个bmp文件,请高手说说怎么保存?(直接用ole1.savetofile是不行的,保存的是OLE本身) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 procedure TForm1.BitBtn2Click(Sender: TObject);var Data: IDataObject; SM: TStgMedium; FormatEtc: TFormatEtc; Bmp: TBitmap;begin OleContainer1.DoVerb(ovShow); Data := OleContainer1.OleObjectInterface as IDataObject; FormatEtc.cfFormat := CF_BITMAP; FormatEtc.tymed := TYMED_GDI; FormatEtc.ptd := nil; FormatEtc.dwAspect := DVASPECT_CONTENT; FormatEtc.lindex := -1; Bmp := TBitmap.Create; try OleCheck(Data.GetData(FormatEtc, SM)); try Bmp.LoadFromClipboardFormat(CF_BITMAP, SM.hBitmap, 0); Bmp.SaveToFile('e:\Test.bmp'); finally ReleaseStgMedium(SM); end; finally Bmp.Free; end;end; uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, OleCtnrs, ActiveX, ComObj, ComCtrls, ExtCtrls, Buttons; 前几天我用平常的办法问这个问题,没有人回答我,现在只好用激将法了,看来真管用。不过那些说这个问题很简单的朋友,你能不能给一个比boytomato(深爱一人叫颖的女孩!) 更简单的办法呢?多谢boytomato(深爱一人叫颖的女孩!) ! ****请问一个关于TREEVIEW的简单问题**** 数据库连接问题 ??一个关于票据打印的问题?? 关于application.processmessage的问题 急求installshield express for delphi 7.0 丽嘉数据中心,免费提供IP,SIM卡,ID身份证查询验证.欢迎您的访问! up有分! 有这样的函数吗??? 如何用FindWind找到IE浏览器的窗口? 请问谁有比较好的扫描仪控件? 大家帮我看看这段代码 ASTA3怎么使用呢? NMConst.dcu是什么文件?
var
Data: IDataObject;
SM: TStgMedium;
FormatEtc: TFormatEtc;
Bmp: TBitmap;
begin
OleContainer1.DoVerb(ovShow);
Data := OleContainer1.OleObjectInterface as IDataObject; FormatEtc.cfFormat := CF_BITMAP;
FormatEtc.tymed := TYMED_GDI;
FormatEtc.ptd := nil;
FormatEtc.dwAspect := DVASPECT_CONTENT;
FormatEtc.lindex := -1; Bmp := TBitmap.Create;
try
OleCheck(Data.GetData(FormatEtc, SM));
try
Bmp.LoadFromClipboardFormat(CF_BITMAP, SM.hBitmap, 0);
Bmp.SaveToFile('e:\Test.bmp');
finally
ReleaseStgMedium(SM);
end;
finally
Bmp.Free;
end;
end;
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, OleCtnrs, ActiveX, ComObj, ComCtrls, ExtCtrls, Buttons;