|
TalMap SDK Libary Reference |
XPOIStyle::SetPenImage |
Pen Image¸¦ ¼³Á¤ÇÕ´Ï´Ù. |
|
|
|
Parameters
|
Name |
±¸ºÐ À̸§ |
ImagePath |
À̹ÌÁö °æ·Î |
UseImageMan |
XImageMan »ç¿ë ¿©ºÎ.(FALSE/TRUE) |
|
|
|
|
Return Value
|
¼º°ø ¿©ºÎ.
FALSE: ½ÇÆÐ.
TRUE: ¼º°ø.
|
|
|
|
Remarks
|
SetPenImage ´Â XPOIStyle ÀÇ Method·Î Á¦°øµË´Ï´Ù.
»ç¿ëÀÚ´Â ÀÌ ¸Þ¼Òµå¸¦ ÀÌ¿ëÇÏ¿© Pen Image¸¦ ¼³Á¤ÇÒ ¼ö ÀÖ½À´Ï´Ù.
UseImageManÀÌ tureÀÎ °æ¿ì ImageMan¿¡¼ Name ÀÇ Image ¸¦ ã°í ¾ø´Â °æ¿ì »õ·Î NameÀ» »ý¼º ÇÕ´Ï´Ù.
|
|
|
|
Example
|
|
// step1. POI group »ý¼º
var group = m_Map.GetCtrlMan().GetPOIMan().FindGroup(1);
if (!group)
group = m_Map.GetCtrlMan().GetPOIMan().NewGroup(1);
// step2. Style »ý¼º
var style = m_Map.GetCtrlMan().GetPOIMan().FindStyle(1);
if (!style)
{
style = m_Map.GetCtrlMan().GetPOIMan().NewStyle(1);
style.SetGDIFont("±¼¸²", 0, 8);
style.SetFontColor(Map.GetUtility().RGBColor(255, 0, 0));
style.SetFontOutColor(Map.GetUtility().RGBColor(255, 255, 255));
style.SetBrush(Map.GetUtility().RGBColor(100, 0, 255), 0);
style.SetPen(Map.GetUtility().RGBColor(0, 0, 0), 1, 0);
style.SetPenImage("pen", "http://localhost/Image/1.png", true);
style.SetBrushImage("brush", "http://localhost/Image/2.png", true);
}
// step3. group ¿¡ ½ºÅ¸ÀÏ Àû¿ë
group.SetStyle(style);
Map.GetCtrlMan().GetImageMan().SetDefaultPath("http://localhost/Theme/Image");
var poiImage = m_Map.GetCtrlMan().GetImageMan().LoadImageList("POIIMAGE", "CAR.png", 64, 64);
// step4. POI Item »ý¼º
var item = group.NewItem(-1); // ¾ÆÀ̵ð ÀÚµ¿ »ý¼º
item.SetLonLat(45706591, 13494596);
item.SetImage(poiImage);
item.SetShowImage(1);
item.SetTextStyle(m_Map.GetUtility().GetConstToValue("DRAWTEXT_STYLE_BOARDOUTLINE"));
item.SetStyle(style);
item.SetCaption("POI Test");
item.SetAngle(30);
item.SetImageOffset(0);
item.SetAlpha(100);
item.SetAnimation(200);
|
|
|
CXUtility util = m_Map.GetUtility();
// Step1. ÁöµµÁß½ÉÁÂÇ¥¸¦ ±¸ÇÕ´Ï´Ù.
CXControlState ctrlstate = ctrlman.GetControlState();
CXPoint posLL = ctrlstate.GetLLCenter();
// Step2. POI Group À» »ý¼º ÇÕ´Ï´Ù.
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.SetPenImage(_T("PEN"), _T("C:\\Program Files (x86)\\TalMapX SDK\\Theme\\Image\\UI\\1.png"), true);
}
group.SetStyle(style);
// Step4. POI¿¡ »ç¿ëÇÒ À̹ÌÁö¸¦ ·Îµù ÇÕ´Ï´Ù.
CXImageMan imageman = ctrlman.GetImageMan();
imageman.SetDefaultPath(ctrlman.GetDefaultPath()+_T("\\Theme\\"));
CXMagicImageList image = imageman.LoadImageList(_T("CAR_IMAGE"), _T("Image\\CAR.png"), 64, 64);
// Step5. POI Item À» »ý¼º ÇÕ´Ï´Ù.
CXPOIItem poi = group.NewItem(-1); // ID°¡ -1 ÀÌ¸é ¼øÂ÷Àû ID ÀÚµ¿»ý¼º.
poi.SetLonLat(posLL.GetX(), posLL.GetY()); // POI ÁÂÇ¥ ^^¼³Á¤
poi.SetImage(image); // POI À̹ÌÁö ¼³Á¤
poi.SetShowImage(1); // POI À̹ÌÁö Ç¥Ãâ (0 À̸é Ç¥Ãâ ÇÏÁö ¾ÊÀ½)
poi.SetImageIndex(0); // ImageList ¸¦ »ç¿ëÇÒ °æ¿ì À̹ÌÁöÀÇ Index
poi.SetImageOffset(3); // À̹ÌÁö offset
poi.SetTextStyle(0x12); // ÅØ½ºÆ® ½ºÅ¸ÀÏ
poi.SetStyle(style); // À§¿¡¼ »ý¼ºÇÑ ½ºÅ¸ÀÏ ÁöÁ¤, group ¿¡¼ ÁöÁ¤ÇßÀ¸¸é »ý·« °¡´É
poi.SetCaption(_T("Caption")); // ĸ¼Ç
poi.SetContents(_T("Contents \r\nContents \r\nContents \r\nContents \r\nContents \r\n"));// ÄÁÅÙÃ÷
poi.SetAnimation(200); // ImageList ¸¦ »ç¿ëÇÑ °æ¿ì ¾Ö´Ï¸ÞÀÌ¼Ç ±â´É.
poi.SetAngle(90); // ȸÀü°¢µµ
poi.SetAlpha(100); // Åõ¸íµµ 0~100
CString msg;
msg.Format(_T("On POI Click GroupID (%d)\n"),group.GetID());
OutputDebugString(msg);
|
|
|
|
See Also
|
|