本文整理汇总了Java中android.graphics.Paint.setSubpixelText方法的典型用法代码示例。如果您正苦于以下问题:Java Paint.setSubpixelText方法的具体用法?Java Paint.setSubpixelText怎么用?Java Paint.setSubpixelText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.graphics.Paint
的用法示例。
在下文中一共展示了Paint.setSubpixelText方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initPaint
import android.graphics.Paint; //导入方法依赖的package包/类
private void initPaint() {
//绘制提示的画笔
mTipPaint = new Paint();
mTipPaint.setColor(mPageView.getTextColor());
mTipPaint.setTextAlign(Paint.Align.LEFT);//绘制的起始点
mTipPaint.setTextSize(ScreenUtils.spToPx(mContext, DEFAULT_TIP_SIZE));//Tip默认的字体大小
mTipPaint.setAntiAlias(true);
mTipPaint.setSubpixelText(true);
//绘制页面内容的画笔
mTextPaint = new TextPaint();
mTextPaint.setColor(mPageView.getTextColor());
mTextPaint.setTextSize(mPageView.getTextSize());
mTextPaint.setAntiAlias(true);
mBgPaint = new Paint();
mBgPaint.setColor(mPageView.getPageBackground());
mBatteryPaint = new Paint();
mBatteryPaint.setAntiAlias(true);
mBatteryPaint.setDither(true);
mBatteryPaint.setColor(mPageView.getTextColor());
}
示例2: getTextPaintByName
import android.graphics.Paint; //导入方法依赖的package包/类
static public Paint getTextPaintByName(String name) {
if (name == null) {
return getDefTextPaint();
}
TypefaceInfo typefaceInfo = _font_map.get(name);
if (typefaceInfo == null) {
return getDefTextPaint();
}
Paint paint = typefaceInfo.paint;
if (paint == null) {
typefaceInfo.paint = paint = new Paint();
paint.setTypeface(typefaceInfo.typeface);
paint.setAntiAlias(true);
paint.setSubpixelText(true);
}
return paint;
}
示例3: getShadowTextPaintByName
import android.graphics.Paint; //导入方法依赖的package包/类
static public Paint getShadowTextPaintByName(String name) {
if (name == null) {
return getDefShadowTextPaint();
}
TypefaceInfo typefaceInfo = _font_map.get(name);
if (typefaceInfo == null) {
return getDefShadowTextPaint();
}
Paint paint = typefaceInfo.paint;
if (paint == null) {
typefaceInfo.paint = paint = new Paint();
paint.setTypeface(typefaceInfo.typeface);
paint.setAntiAlias(true);
paint.setSubpixelText(true);
paint.setShadowLayer(3, 0, 0, Color.BLACK);
}
return paint;
}
示例4: getWeatherIcon
import android.graphics.Paint; //导入方法依赖的package包/类
protected Bitmap getWeatherIcon(String text, Context context) {
Bitmap myBitmap = Bitmap.createBitmap(256, 256, Bitmap.Config.ARGB_4444);
Canvas myCanvas = new Canvas(myBitmap);
Paint paint = new Paint();
Typeface clock = Typeface.createFromAsset(context.getAssets(), "fonts/weather.ttf");
paint.setAntiAlias(true);
paint.setSubpixelText(true);
paint.setTypeface(clock);
paint.setStyle(Paint.Style.FILL);
paint.setColor(Color.WHITE);
paint.setTextSize(150);
paint.setTextAlign(Paint.Align.CENTER);
myCanvas.drawText(text, 128, 180, paint);
return myBitmap;
}
示例5: initPaint
import android.graphics.Paint; //导入方法依赖的package包/类
private void initPaint(){
//绘制提示的画笔
mTipPaint = new Paint();
mTipPaint.setColor(mTextColor);
mTipPaint.setTextAlign(Paint.Align.LEFT);//绘制的起始点
mTipPaint.setTextSize(ScreenUtils.spToPx(DEFAULT_TIP_SIZE));//Tip默认的字体大小
mTipPaint.setAntiAlias(true);
mTipPaint.setSubpixelText(true);
//绘制页面内容的画笔
mTextPaint = new TextPaint();
mTextPaint.setColor(mTextColor);
mTextPaint.setTextSize(mTextSize);
mTextPaint.setAntiAlias(true);
//绘制标题的画笔
mTitlePaint = new TextPaint();
mTitlePaint.setColor(mTextColor);
mTitlePaint.setTextSize(mTitleSize);
mTitlePaint.setStyle(Paint.Style.FILL_AND_STROKE);
mTitlePaint.setTypeface(Typeface.DEFAULT_BOLD);
mTitlePaint.setAntiAlias(true);
//绘制背景的画笔
mBgPaint = new Paint();
mBgPaint.setColor(mPageBg);
mBatteryPaint = new Paint();
mBatteryPaint.setAntiAlias(true);
mBatteryPaint.setDither(true);
if (isNightMode){
mBatteryPaint.setColor(Color.WHITE);
}
else {
mBatteryPaint.setColor(Color.BLACK);
}
}
示例6: ExtraButtonsView
import android.graphics.Paint; //导入方法依赖的package包/类
public ExtraButtonsView(Context context) {
super(context);
mTextPaint = new Paint();
mTextPaint.setTextSize(15 * getResources().getDisplayMetrics().density);
mTextPaint.setTypeface(Typeface.DEFAULT_BOLD);
mTextPaint.setTextAlign(Paint.Align.CENTER);
mTextPaint.setStyle(Paint.Style.FILL);
mTextPaint.setSubpixelText(false);
}
示例7: init
import android.graphics.Paint; //导入方法依赖的package包/类
private void init() {
mColor = getResources().getColor(R.color.hcf_material_font_view);
mIcon = Icon.I_HELP_OUTLINE;
mPaint = new Paint();
mPaint.setColor(mColor);
mPaint.setTypeface(MaterialFont.getTypeface());
mPaint.setSubpixelText(true);
mPaint.setAntiAlias(true);
mTextSize = 12;
mPaint.setTextSize(mTextSize);
}
示例8: init
import android.graphics.Paint; //导入方法依赖的package包/类
private void init(Context context, @Nullable AttributeSet attrs){
defaultWidth = 600;
defaultHeight = 1000;
a = new MyPoint();
f = new MyPoint();
g = new MyPoint();
e = new MyPoint();
h = new MyPoint();
c = new MyPoint();
j = new MyPoint();
b = new MyPoint();
k = new MyPoint();
d = new MyPoint();
i = new MyPoint();
pointPaint = new Paint();
pointPaint.setColor(Color.RED);
pointPaint.setTextSize(25);
pointPaint.setStyle(Paint.Style.STROKE);
bgPaint = new Paint();
bgPaint.setColor(Color.GREEN);
pathAPaint = new Paint();
pathAPaint.setColor(Color.GREEN);
pathAPaint.setAntiAlias(true);//设置抗锯齿
pathBPaint = new Paint();
pathBPaint.setColor(getResources().getColor(R.color.blue_light));
pathBPaint.setAntiAlias(true);//设置抗锯齿
// pathBPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_ATOP));我们不需要单独绘制path了,记得注释掉
pathCPaint = new Paint();
pathCPaint.setColor(Color.YELLOW);
pathCPaint.setAntiAlias(true);//设置抗锯齿
// pathCPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_ATOP));
// pathCPaint.setStyle(Paint.Style.STROKE);
pathCContentPaint = new Paint();
pathCContentPaint.setColor(Color.YELLOW);
pathCContentPaint.setAntiAlias(true);//设置抗锯齿
textPaint = new Paint();
textPaint.setColor(Color.BLACK);
textPaint.setTextAlign(Paint.Align.CENTER);
textPaint.setSubpixelText(true);//设置自像素。如果该项为true,将有助于文本在LCD屏幕上的显示效果。
textPaint.setTextSize(30);
pathA = new Path();
pathB = new Path();
pathC = new Path();
style = STYLE_LOWER_RIGHT;
mScroller = new Scroller(context,new LinearInterpolator());
mMatrix = new Matrix();
createGradientDrawable();
}