@@ -29,11 +29,23 @@ public GMapMarkerWP(PointLatLng p, string wpno)
29
29
Bitmap temp = new Bitmap ( 100 , 40 , PixelFormat . Format32bppArgb ) ;
30
30
using ( Graphics g = Graphics . FromImage ( temp ) )
31
31
{
32
- g . InterpolationMode = System . Drawing . Drawing2D . InterpolationMode . HighQualityBicubic ;
32
+ g . InterpolationMode = System . Drawing . Drawing2D . InterpolationMode . High ;
33
+ g . TextRenderingHint = System . Drawing . Text . TextRenderingHint . AntiAliasGridFit ;
33
34
g . SmoothingMode = System . Drawing . Drawing2D . SmoothingMode . HighQuality ;
35
+ g . CompositingQuality = System . Drawing . Drawing2D . CompositingQuality . HighQuality ;
34
36
txtsize = g . MeasureString ( wpno , font ) ;
35
37
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
+
37
49
}
38
50
fontBitmaps [ wpno ] = temp ;
39
51
}
@@ -46,12 +58,15 @@ public override void OnRender(IGraphics g)
46
58
g . FillEllipse ( Brushes . Red , new Rectangle ( this . LocalPosition , this . Size ) ) ;
47
59
g . DrawArc ( Pens . Red , new Rectangle ( this . LocalPosition , this . Size ) , 0 , 360 ) ;
48
60
}
49
-
61
+
50
62
base . OnRender ( g ) ;
51
63
52
64
var midw = LocalPosition . X + 10 ;
53
65
var midh = LocalPosition . Y + 3 ;
54
66
67
+ // need to recalculate textsize for redrawing
68
+ txtsize = g . MeasureString ( wpno , font ) ;
69
+
55
70
if ( txtsize . Width > 15 )
56
71
midw -= 4 ;
57
72
0 commit comments