|
TalMap SDK Libary Reference |
XPOIStyle::SetGDIFont |
GDI Font 를 설정합니다. |
|
|
|
Parameters
|
FontName |
Font Name |
Style |
스타일
XUtility.GetConstToValue(String Value)
TM_FONT_STYLE_NORMAL | 0x00 |
TM_FONT_STYLE_BOLD | 0x01 |
TM_FONT_STYLE_ITALIC | 0x02 |
TM_FONT_STYLE_UNDERLINE | 0x04 |
TM_FONT_STYLE_STRIKEOUT | 0x08 |
|
Size |
크기 |
|
|
|
|
Return Value
|
|
Remarks
|
SetGDIFont 는 XPOIStyle 의 Method로 제공됩니다.
사용자는 이 메소드를 이용하여 GDI Font를 설정할 수 있습니다.
|
|
|
|
Example
|
|
var ctrlman = m_Map.GetCtrlMan();
var ctrlstate = ctrlman.GetControlState();
var util = m_Map.GetUtility();
var posLL = ctrlstate.GetLLCenter(); //지도의 중심좌표
var itemCount = 3;
var poiman = ctrlman.GetPOIMan();
var baseman = poiman.CasttoBaseManager();
var group = poiman.FindGroup(10);
if (!group) group = poiman.NewGroup(10);
// Step 2-1. Make POI Style
var gstyle = poiman.FindStyle(1);
if (!gstyle) {
gstyle = poiman.NewStyle(1); // -1: 아이디 자동 생성
gstyle.SetGDIFont("굴림", 0, 8);
gstyle.SetFontColor(util.RGBColor(255, 0, 0));
gstyle.SetFontOutColor(util.RGBColor(255, 255, 255));
gstyle.SetBrush(util.RGBColor(100, 0, 255), 0);
gstyle.SetPen(util.RGBColor(0, 0, 0), 1, 0);
}
// Group에 Style을 지정하면 하위 Item은 별도의 Style을 가지지 않는 한 Group의 Style을 따르게 된다.
group.SetStyle(gstyle);
var style = poiman.FindStyle(2);
if (!style) {
style = poiman.NewStyle(2);
style.SetGDIFont("굴림", 0, 8);
style.SetFontColor(util.RGBColor(0, 0, 0));
style.SetFontOutColor(util.RGBColor(255, 255, 255));
style.SetBrush(util.RGBColor(100, 0, 255), 0);
style.SetPen(util.RGBColor(0, 0, 0), 1, 0);
}
// Step 3. Make POI Items
var imageman = ctrlman.GetImageMan();
imageman.SetDefaultPath("http://www.talmap.co.kr/tutorial/");
var image = imageman.LoadImageList("CAR_IMAGE", "image/CAR.png", 64, 64);
if (image.IsValid() != true) alert("Image 이상");
var angle = 0;
for (i = 0; i < itemCount; i++) {
var item = group.NewItem(-1)
item.SetLonLat(posLL._X + i * 250, posLL._Y - i * 250)
item.SetImage(image);
item.SetShowImage(1)
item.SetImageIndex(1)
item.SetImageOffset(4)
item.SetTextStyle(0x12)
if (i % 2) item.SetStyle(style)
item.SetCaption("[" + i + "]Test POI")
item.SetContents("[" + i + "] Contents\nHello")
item.SetAnimation(200) // 1초 단위
item.SetSyncAngle(1)
item.SetAngle(angle)
item.SetAlpha(100)
angle = angle + 10;
if(angle > 360) angle = 0;
}
|
|
|
CXPOIMan poiman = ctrlman.GetPOIMan();
CXPOIGroup group = poiman.FindGroup(100);
if (group.m_lpDispatch == NULL)
group = poiman.NewGroup(100);
// Step3. POI Style 을 생성 합니다.
CXPOIStyle style = poiman.FindStyle(1000);
if (style.m_lpDispatch == NULL) {
style = poiman.NewStyle(1000);
style.SetGDIFont(_T("굴림"), 0, 8);
style.SetFontColor(util.RGBColor(255, 0, 0));
style.SetFontOutColor(util.RGBColor(255, 255, 255));
style.SetBrush(util.RGBColor(100, 0, 255), 0);
style.SetPen(util.RGBColor(0, 0, 0), 1, 0);
style.SetVisibleCtrl(1,1);
}
group.SetStyle(style);
|
|
|
|
See Also
|
|