public class CustomMarker : GMapMarker
{
Pen Pen1;
SolidBrush Brush1;
SolidBrush Brush2;
public CustomMarker(PointLatLng p, Color fillColor)
: base(p)
{
Pen1 = new Pen(Color.Black, 1.6f);
Brush1 = new SolidBrush(Color.Black);
Brush2 = new SolidBrush(fillColor);
}
public override void OnRender(Graphics g)
{
g.SmoothingMode = SmoothingMode.AntiAlias;
GraphicsPath GraphicsPath1 = new GraphicsPath();
GraphicsPath1.AddBeziers(new Point(LocalPosition.X + 1, LocalPosition.Y), new Point(LocalPosition.X, LocalPosition.Y - 7), new Point(LocalPosition.X - 1, LocalPosition.Y - 13), new Point(LocalPosition.X - 7, LocalPosition.Y - 19));
GraphicsPath1.AddBeziers(new Point(LocalPosition.X + 9, LocalPosition.Y - 19), new Point(LocalPosition.X + 3, LocalPosition.Y - 13), new Point(LocalPosition.X + 3, LocalPosition.Y - 7), new Point(LocalPosition.X + 1, LocalPosition.Y));
GraphicsPath GraphicsPath2 = new GraphicsPath();
GraphicsPath2.AddEllipse(LocalPosition.X - 8, LocalPosition.Y - 33, 18, 18);
g.FillPath(Brush2, GraphicsPath2);
g.DrawPath(Pen1, GraphicsPath2);
g.SetClip(new Rectangle(LocalPosition.X - 10, LocalPosition.Y - 17, 21, 18));
g.FillPath(Brush2, GraphicsPath1);
g.DrawPath(Pen1, GraphicsPath1);
g.ResetClip();
//g.FillEllipse(Brush1, new Rectangle(LocalPosition.X + 6, LocalPosition.Y + 6, 7, 7)); // <-- 안에 점넣는거
}
}
무식하게 직접 마커 그린 뒤 안에 원하는 색채워 넣는 식
외국사이트에서 퍼와서 내입맛에 맞게 고침
제공하는 Marker엔 없는 색깔들 ㅎ
'▩▩ 프로그래밍 ▩▩ > C#' 카테고리의 다른 글
[C#] img --> byte[], byte[] --> img (0) | 2014.03.13 |
---|---|
[C#] string --> int (0) | 2014.01.17 |
[TeeChart] TeeChart tutorial (2) | 2013.11.26 |
[C#] DataGridView 셀 가운데정렬 (0) | 2013.11.13 |
[C#] MessageBox 선택 (0) | 2013.11.05 |
[C#] 8 bit color(Hexadecimal code) --> color (0) | 2013.11.05 |
[C#] ToolStrip의 ComboBox에서 SelectionChangeCommitted 쓰고싶을 때 (0) | 2013.10.28 |
[C#] Combobox --> ReadOnly 만들기 (0) | 2013.10.28 |