当前位置: 首页>>代码示例>>Java>>正文


Java Paint.setUnderlineText方法代码示例

本文整理汇总了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;
}
 
开发者ID:shivam301296,项目名称:True-Weather,代码行数:23,代码来源:Share.java

示例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);
    }
}
 
开发者ID:noties,项目名称:Markwon,代码行数:8,代码来源:SpannableTheme.java

示例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;
}
 
开发者ID:starcor-company,项目名称:starcor.xul,代码行数:28,代码来源:XulSpannedLabelRender.java

示例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;
}
 
开发者ID:starcor-company,项目名称:starcor.xul,代码行数:33,代码来源:XulBasicTextRenderer.java


注:本文中的android.graphics.Paint.setUnderlineText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。