1.The name that you specify should not include a full directory path. The bitmap file must be in the custom symbol directory, currently defined to be:
<path>/CUSTSYMB
where <path> is the path where the MapX Common Files are installed, e.g. C:/Program Files/Common Files/MapInfo Shared/MapXCommon.
2.定义style
var
Bitmaps: BitmapSymbols;
StyleBitmap: Style;
begin
Bitmaps := CoBitmapSymbols.Create;
StyleBitmap := coStyle.Create;
with StyleBitmapdo
begin
// Style.SupportsBitmapSymbols property
SymbolType := miSymbolTypeBitmap;
SymbolBitmapTransparent := True;
SymbolBitmapSize := 24;//位图大小
SymbolBitmapName := Bitmaps.Item(BmpFileNo).Name;//BmpFileNo是位图编号
end;
end;
3.画
var
Newobj : Feature;
pt : Point;
begin
pt =: coPoint.create;
pt.Set_(mLongitude, mLatitude);//mLongitude, mLatitude你的地图位置
Newobj := MapX.FeatureFactory.CreateSymbol(pt, StyleBitmap);
Newobj.KeyValue := 'Symbol';//你的标注
Newobj:= lyrEditLayer.AddFeature(NewObj, EmptyParam);//lyrEditLayer是你所要画的图层
end;