|
TalMap SDK Libary Reference |
XPOIStyle::SetBrushImage |
Brush를 설정합니다. |
|
|
|
Parameters
|
Name |
구분 이름 |
ImagePath |
이미지 경로 |
UseImageMan |
XImageMan 사용 여부.(FALSE/TRUE) |
|
|
|
|
Return Value
|
성공 여부.
FALSE: 실패.
TRUE: 성공.
|
|
|
|
Remarks
|
SetBrushImage 는 XPOIStyle 의 Method로 제공됩니다.
사용자는 이 메소드를 이용하여 Brush Image를 설정할 수 있습니다.
|
|
|
|
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.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);
style.SetBrushImage(_T("PEN"), _T("C:\\Program Files (x86)\\TalMapX SDK\\Theme\\Image\\UI\\2.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
|
|