我在D6+F16.1中调用ObjCreatePicture()方法出现"Class EOleException with message 无效的参数,不知如何解决??
代码如下:
var
ObjID: integer;
nX1: integer;
nY1: integer;
nX2: integer;
nY2: integer;
hMF: HWND;
nMapMode: integer;
nWndExtentX: integer;
nWndExtentY: integer;
begin
nX1 := 1;
nY1 := 1;
nX2 := 4;
nY2 := 12;
nMapMode := 8;
hMF := image1.Picture.Metafile.Handle;
nWndExtentX := image1.Picture.Metafile.width;
nWndExtentY := image1.Picture.Metafile.Height; objid := f.ObjCreatePicture(nX1, nY1, nX2, nY2, hmf, nMapMode, nWndExtentX, nWndExtentY);
end;
代码如下:
var
ObjID: integer;
nX1: integer;
nY1: integer;
nX2: integer;
nY2: integer;
hMF: HWND;
nMapMode: integer;
nWndExtentX: integer;
nWndExtentY: integer;
begin
nX1 := 1;
nY1 := 1;
nX2 := 4;
nY2 := 12;
nMapMode := 8;
hMF := image1.Picture.Metafile.Handle;
nWndExtentX := image1.Picture.Metafile.width;
nWndExtentY := image1.Picture.Metafile.Height; objid := f.ObjCreatePicture(nX1, nY1, nX2, nY2, hmf, nMapMode, nWndExtentX, nWndExtentY);
end;
解决方案 »
- delphi BHO 新手问题
- 主机发信号,客户机执行,但是客户机不知道主机什么时候发信号(环境互联网)
- 请问各位:
- 请大家帮忙,不胜感激~~我是初学者
- 需要DELPHI代码的请进~~~另于高分相送(进者有分)
- listview的rightclick问题。
- delphi6.0的注册码
- 【200分紧急求助】”用QR的ON NEEDDATA、打印内容所在BAND的AFTER PRINT事件中进行判断,可控制打印行数、不足一页用空行填满。“这个
- 用DELPH在NT内核的操作系统(Windows NT/2000/XP)下如何制作拨号上网程序?
- 《Delphi淡手辑略 之 数据库篇》:数据集解构成树(过程)
- 如何查询值为空字符串的那些记录
- 问一个我一直疑惑的问题:Owner与Parent各是什么作用?有什么区别?
nWndExtentY Part Type Description
nX1, nY1 Single Coordinates that represent the first anchor point of the object. nX1 is measured in columns from the left edge of the worksheet; nY1 is measured in rows from the top edge of the worksheet.
nX2, nY2 Single Coordinates that represent the second anchor point of the object. nX2 is measured in columns from the left edge of the worksheet; nY2 is measured in rows from the top edge of the worksheet.
hMF OLE_HANDLE Handle to the metafile to place in the picture object.
nMapMode Long Indicates how the metafile is mapped in the object. 7 indicates isotropic mode (keep aspect ratio); 8 is anisotropic mode (stretchable).
nWndExtentX,
nWndExtentY Long Dimensions of the picture.
ID Long Sets the identification number of the new picture object.
ReshMF, nMapMode, and nWndExtentX and nWndExtentY usually accompany a metafile and are merely passed to this method. You should be familiar with Windows metafiles and their structure before using this method. Isotropic and anisotropic are Windows constants listed as MM_ISOTROPIC and MM_ANISOTROPIC.
Formula One manages the memory associated with a metafile once a picture object has been created, including freeing memory when the object is deleted.When specifying the location of the picture object, integers place the edge of the object on a row or column border; fractional numbers place the edge of the object between borders. For example, if nX1 is 1.25, the first anchor point is placed one and a quarter columns from the left edge of the worksheet; if nY1 is 3, the first anchor point is placed exactly three rows from the top of the worksheet.Copyright ?1998, Tidestone Technologies, Inc.
[email protected]谢谢