1. Preface
2. Solutions
/*** Text conversion bitmap *@paramtext *@return */ Public Staticdrawable createmapbitmap (String text) {intSize = 50; intHeight = 60; if(commonvalue.dpilevel==1) {size= 22; Height= 30; }Else if(commonvalue.dpilevel==2) {size= 50; Height= 60; } Paint Paint=NewPaint (); Paint.setcolor (Color.Blue); Paint.settextsize (size); Paint.setantialias (true); Paint.settextalign (align.left);//location floatTextLength =paint.measuretext (text); intwidth = (int) TextLength; Bitmap newb= Bitmap.createbitmap (width*2, height*2, config.argb_8888); Canvas CV=NewCanvas (NEWB); Cv.drawcolor (Color.parsecolor ("#00000000")); Cv.setdrawfilter (NewPaintflagsdrawfilter (0, Paint.anti_alias_flag|Paint.filter_bitmap_flag)); Cv.drawtext (text, width, size, paint); Cv.save (Canvas.all_save_flag);//SaveCv.restore ();//Storage return Newbitmapdrawable (NEWB); }
3. Reference links
http://blog.csdn.net/u014014578/article/details/36180485
ArcGIS for Android 10.1.1API Chinese callout Causes program exception crash problem