本文整理汇总了Java中android.graphics.Paint.setUnderlineText方法的典型用法代码示例。如果您正苦于以下问题:Java Paint.setUnderlineText方法的具体用法?Java Paint.setUnderlineText怎么用?Java Paint.setUnderlineText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.graphics.Paint
的用法示例。
在下文中一共展示了Paint.setUnderlineText方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: mark
import android.graphics.Paint; //导入方法依赖的package包/类
public static Bitmap mark(Bitmap src, String watermark) {
int w = src.getWidth();
int h = src.getHeight();
Bitmap result = Bitmap.createBitmap(w, h, src.getConfig());
Point location= new Point(50,30);
float size= 30;
boolean underline= true;
Canvas canvas = new Canvas(result);
canvas.drawBitmap(src, 0, 0, null);
Paint paint = new Paint();
paint.setColor(Color.rgb(6,36,122));
//paint.setAlpha(alpha);
paint.setTextSize(size);
paint.setAntiAlias(true);
paint.setUnderlineText(underline);
canvas.drawText(watermark, location.x, location.y, paint);
return result;
}
示例2: applyLinkStyle
import android.graphics.Paint; //导入方法依赖的package包/类
public void applyLinkStyle(@NonNull Paint paint) {
paint.setUnderlineText(true);
if (linkColor != 0) {
// by default we will be using text color
paint.setColor(linkColor);
}
}
示例3: _getTextPaint
import android.graphics.Paint; //导入方法依赖的package包/类
private Paint _getTextPaint(float fontSizeScale) {
Paint defPaint = _ctx.getTextPaintByName(_fontFace);
if (!(_fontShadowSize == 0 || (_fontShadowColor & 0xFF000000) == 0)) {
defPaint = _ctx.getShadowTextPaintByName(_fontFace);
defPaint.setShadowLayer(_fontShadowSize, _fontShadowX, _fontShadowY, _fontShadowColor);
}
defPaint.setColor(_fontColor);
if (Math.abs(fontSizeScale - 1.0f) > 0.01f) {
defPaint.setTextSize(_fontSize * fontSizeScale);
} else {
defPaint.setTextSize(_fontSize);
}
//defPaint.setStrokeWidth(_fontWeight / 2.0f);
if (_fontWeight > 1.0) {
defPaint.setFakeBoldText(true);
} else {
defPaint.setFakeBoldText(false);
}
defPaint.setUnderlineText(_fontUnderline);
defPaint.setTextSkewX(_fontItalic ? -0.25f : 0);
defPaint.setTextAlign(Paint.Align.LEFT);
return defPaint;
}
示例4: _getTextPaint
import android.graphics.Paint; //导入方法依赖的package包/类
protected Paint _getTextPaint(float fontSizeScale) {
XulRenderContext ctx = _render.getRenderContext();
Paint defPaint = ctx.getTextPaintByName(_fontFace);
if (!(_fontShadowSize == 0 || (_fontShadowColor & 0xFF000000) == 0)) {
defPaint = ctx.getShadowTextPaintByName(_fontFace);
defPaint.setShadowLayer(_fontShadowSize, _fontShadowX, _fontShadowY, _fontShadowColor);
}
defPaint.setColor(_fontColor);
if (Math.abs(fontSizeScale - 1.0f) > 0.01f) {
defPaint.setTextSize(_fontSize * fontSizeScale);
} else {
defPaint.setTextSize(_fontSize);
}
if (_fontWeight > 1.0) {
if (_fontWeight > 2.5) {
defPaint.setStrokeWidth(_fontWeight*fontSizeScale/2);
} else {
defPaint.setFakeBoldText(true);
}
} else {
defPaint.setFakeBoldText(false);
}
defPaint.setTextScaleX(_fontScaleX);
defPaint.setUnderlineText(_fontUnderline);
defPaint.setStrikeThruText(_fontStrikeThrough);
defPaint.setTextSkewX(_fontItalic ? -0.25f : 0);
defPaint.setTextAlign(Paint.Align.LEFT);
return defPaint;
}