drawing中写字

<pre name="code" class="cpp">// 写字
 
int UsrSurfNoteCreate(ProDrawing drawing,
    // ProSelection surf_sel,      /* The surface - where the note leader
                        //            should be attached. */
     ProVector pos, wchar_t * notestr)              /* The location of the note itself */
{
  ProDtlnotetext text;
  ProName font;
  ProDtlnoteline line;
  ProDtlnotedata ndata;
  ProView view;
  ProDtlattach attach;
  ProDtlnote note;

  ProDtlnotetextAlloc(&text);
  ProDtlnotetextHeightSet(text, -1.0);
  ProDtlnotetextWidthSet(text, -1.0);
  ProDtlnotetextSlantSet(text, 0.0);
  ProDtlnotetextThicknessSet(text, 0.0);
  ProStringToWstring(font, "font");
  ProDtlnotetextFontSet(text, font);

  ProDtlnotetextStringSet(text, notestr);

  ProDtlnotelineAlloc(&line);
  ProDtlnotelineTextAdd(line, text);

  ProDtlnotedataAlloc(drawing, &ndata);
  ProDtlnotedataLineAdd(ndata, line);


  int cur_sheet; 
  ProDrawingCurrentSheetGet (drawing, &cur_sheet);

  ProDrawingBackgroundViewGet (drawing, cur_sheet, &view);

  //ProSelectionViewGet(surf_sel, &view);
  ProDtlattachAlloc(PRO_DTLATTACHTYPE_FREE, view, pos, NULL, &attach);
  ProDtlnotedataAttachmentSet(ndata, attach);

  ProDtlnoteCreate(drawing, NULL, ndata, ¬e);

  ProDtlnoteShow(¬e);

  ProDtlnotedataFree(ndata);

  return 0;
}

// 写字
void CTestDlg2::OnBnClickedButton12()
{
	ProMdl mdl;
	ProError err = ProMdlCurrentGet(&mdl);

	ProDrawing drawing = (ProDrawing)mdl;
	//ProVector pos = {100,100,0};
	wchar_t* notes = {L"WERTYU"};

	ProMouseButton expected_button = PRO_LEFT_BUTTON;
	ProMouseButton button_pressed;
	ProPoint3d position;
	err = ProMousePickGet(expected_button, &button_pressed, position);

	UsrSurfNoteCreate(drawing, position, notes);
}

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值