@@ -29,11 +29,23 @@ public GMapMarkerWP(PointLatLng p, string wpno)
2929 Bitmap temp = new Bitmap ( 100 , 40 , PixelFormat . Format32bppArgb ) ;
3030 using ( Graphics g = Graphics . FromImage ( temp ) )
3131 {
32- g . InterpolationMode = System . Drawing . Drawing2D . InterpolationMode . HighQualityBicubic ;
32+ g . InterpolationMode = System . Drawing . Drawing2D . InterpolationMode . High ;
33+ g . TextRenderingHint = System . Drawing . Text . TextRenderingHint . AntiAliasGridFit ;
3334 g . SmoothingMode = System . Drawing . Drawing2D . SmoothingMode . HighQuality ;
35+ g . CompositingQuality = System . Drawing . Drawing2D . CompositingQuality . HighQuality ;
3436 txtsize = g . MeasureString ( wpno , font ) ;
3537
36- g . DrawString ( wpno , font , Brushes . Black , new PointF ( 0 , 0 ) ) ;
38+ System . Drawing . Drawing2D . GraphicsPath pth = new System . Drawing . Drawing2D . GraphicsPath ( ) ;
39+ pth . AddString (
40+ wpno ,
41+ font . FontFamily ,
42+ ( int ) FontStyle . Regular ,
43+ g . DpiY * ( font . Size ) / 72 ,
44+ new Point ( 0 , 0 ) ,
45+ new StringFormat ( ) ) ;
46+ g . DrawPath ( new Pen ( Brushes . White , 3 ) , pth ) ;
47+ g . DrawPath ( new Pen ( Brushes . Black , 1.5f ) , pth ) ;
48+
3749 }
3850 fontBitmaps [ wpno ] = temp ;
3951 }
@@ -46,12 +58,15 @@ public override void OnRender(IGraphics g)
4658 g . FillEllipse ( Brushes . Red , new Rectangle ( this . LocalPosition , this . Size ) ) ;
4759 g . DrawArc ( Pens . Red , new Rectangle ( this . LocalPosition , this . Size ) , 0 , 360 ) ;
4860 }
49-
61+
5062 base . OnRender ( g ) ;
5163
5264 var midw = LocalPosition . X + 10 ;
5365 var midh = LocalPosition . Y + 3 ;
5466
67+ // need to recalculate textsize for redrawing
68+ txtsize = g . MeasureString ( wpno , font ) ;
69+
5570 if ( txtsize . Width > 15 )
5671 midw -= 4 ;
5772
0 commit comments