www.mxdraw.com
|
返回数据库所有实体的最外包矩形框,默认返回控件当前显示空间的实体外包。
static bool Mx_GetMcDbDatabaseBound(OUT DOUBLE& lLbx, OUT DOUBLE& lLBy, OUT DOUBLE& lRtx, OUT DOUBLE& lRty);
参数 |
说明 |
OUT DOUBLE& lLbx |
返回外包矩形框的左下角X坐标 |
OUT DOUBLE& lLBy |
返回外包矩形框的左下角Y坐标 |
OUT DOUBLE& lRtx |
返回外包矩形框的右上角X坐标 |
OUT DOUBLE& lRty |
返回外包矩形框的右上角Y坐标 |
成功返回true
例如:C#代码
private void GetBound_Click(object sender, EventArgs e) { MxDrawResbuf pRet = (MxDrawResbuf)axMxDrawX1.Call("Mx_GetMcDbDatabaseBound", ""); if(pRet.AtString(0) == "Ok") { MessageBox.Show( "LBx:" + pRet.AtDouble(1).ToString() + "LBy:" + pRet.AtDouble(2).ToString() + "Rtx:" + pRet.AtDouble(3).ToString() + "Rty:" + pRet.AtDouble(4).ToString() ); } else { MessageBox.Show("求外包失败"); } }
例如:Delphi代码
var pRet: MxDrawResbuf; h, w: double; begin if dlgSave1.Execute then begin pRet := MxDrawResbuf(MxDrawX1.Call('Mx_GetMcDbDatabaseBound', '')); if pRet.AtString(0) = 'Ok' then begin MxDrawX1.ViewColor := clWhite; w := pRet.AtDouble(3); w := w - pRet.AtDouble(1) + 1; h := pRet.AtDouble(4); h := h - pRet.AtDouble(2) + 1; if not MxDrawX1.SaveJpgFile(dlgSave1.FileName, Round(w), Round(h),0) then Showmessage('失败') else Showmessage('成功'); end; end;