|
XTextPrinter Class
|
XTextPrinter클래스는 ImageView나 PlanetView, MilMapView상에서 텍스트를 그리기 위해 사용된다.
Inheritance Hierarchy
Namespace: Pixoneer.NXDL.NGRAssembly: NXDLgr (in NXDLgr.dll) Version: 2.0.3.38
Syntaxpublic class XTextPrinter : IDisposable
The XTextPrinter type exposes the following members.
Constructors | Name | Description |
---|
 | XTextPrinter | XTextPrinter클래스의 기본 생성자로서, 멤버변수에 대하여 초기화를 수행한다. |
Top
Methods | Name | Description |
---|
 | Initialize(Font) | 이 객체를 입력 글꼴을 이용하여 초기화한다. |
 | Initialize(Font, Boolean) | 텍스트 출력에 사용할 글꼴과 DPI 대응 여부를 지정하여 초기화한다. |
 | Print(String, XVertex3d, eTextAlign, Color, Boolean, Color) |
스크린 상에 입력된 텍스트를 도시한다.
|
 | Print(String, XVertex3d, eTextAlign, eTextAlignV, Color, Boolean, Color) |
스크린 상에 입력된 텍스트를 도시한다.
|
 | Print(String, XVertex3d, XVertex2d, XVertex2d, Color, Boolean, Color) |
스크린 상에 입력된 텍스트를 도시한다.
|
Top
Example
Form의 Load에서 XTextPrinter를 초기화하고, NXPlanetLayer의 OnRender 이벤트 함수에서 XTextPrinter를 이용해 문자열을 출력한다.
public XTextPrinter m_TextPrinter;
private void FormPlanetView_Load(object sender, EventArgs e)
{
m_TextPrinter = new XTextPrinter();
Font myFont = new Font("Gulim", 12, FontStyle.Strikeout | FontStyle.Underline | FontStyle.Bold);
m_TextPrinter.Initialize(myFont);
}
private bool nxPlanetLayer1_OnRender(object sender, Pixoneer.NXDL.NXPlanet.NXPlanetDrawArgs e)
{
XVertex3d pt1 = e.ViewArea.GeographicToWorld(XGeoPoint.FromDegree(127.0, 37.0, 0));
XVertex3d pt2 = e.ViewArea.GeographicToWorld(XGeoPoint.FromDegree(127.0, 38.0, 0));
e.Graphics.glDisable(XGraphics.GL_DEPTH_TEST);
e.Graphics.glPushMatrix();
e.Graphics.glTranslated(-e.WOS.x, -e.WOS.y, -e.WOS.z);
e.Graphics.glColor3f(1.0f, 0.0f, 0.0f);
e.Graphics.glBegin(XGraphics.GL_LINES);
e.Graphics.glVertex3d(pt1.x, pt1.y, pt1.z);
e.Graphics.glVertex3d(pt2.x, pt2.y, pt2.z);
e.Graphics.glEnd();
e.Graphics.glColor3f(1.0f, 1.0f, 1.0f);
e.Graphics.glEnable(XGraphics.GL_DEPTH_TEST);
XVertex2d posOffset = new XVertex2d(0, 0);
XVertex2d align = new XVertex2d(0, 0);
m_TextPrinter.Print("127.0, 37.0", pt1, posOffset, align, Color.Black, true, Color.Gray);
m_TextPrinter.Print("127.0, 38.0", pt2, posOffset, align, Color.Black, true, Color.Gray);
e.Graphics.glPopMatrix();
return default(bool);
}
See Also