我在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;

解决方案 »

  1.   

    ID = F1Book1.ObjCreatePicture nX1, nY1, nX2, nY2, hMF, nMapMode, nWndExtentX,
    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.
      

  2.   

    主要是DELPHI 把WMF都改成EMF文件了,所以不行的
      

  3.   

    如果可以,分数在谈
    [email protected]谢谢