该接口对应一个可绘制文本的对象。
使用这个接口,需要创建一个 LText 对象。
示例代码
C++
ILTextPtr myText = LText::Create();
myText->Text = L"My Text";
myText->PosX = 200;
myText->PosY = 200;
((ILDrawablePtr)myText).SetPenColor(
LPVColor.LPVRed));
displayCtrl->AddObject(myText, 0);
myText->Draw(hdc, zoomX, zoomY, panX, panY);
LPVColor
该枚举表示一些常用的颜色
Definition: LPVCore.idl:1529
@ LPVAlignCenter
Definition: LPVDisplay.idl:200
C#
LText myText = new LText();
myText.Text = "My Text";
myText.PosX = 200;
myText.PosY = 200;
((ILDrawablePtr)myText).SetPenColor(
LPVColor.LPVRed));
displayCtrl.AddObject(myText, 0);
myText.Draw(hdc, zoomX, zoomY, panX, panY);
COM
ILTextPtr myText = LText::Create();
myText->Text = L"My Text";
myText->PosX = 200;
myText->PosY = 200;
*((ILDrawable)m_ytext).SetPenColor((uint)
LPVColor.LPVRed);
displayCtrl->AddObject(myText, 0);
myText->Draw(hdc, zoomX, zoomY, panX, panY);
注:该接口在 Linux / MacOS 平台暂不可用。