當前位置: 首頁>>代碼示例>>Java>>正文


Java Paint.setSubpixelText方法代碼示例

本文整理匯總了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());

}
 
開發者ID:z-chu,項目名稱:FriendBook,代碼行數:25,代碼來源:PageLoader.java

示例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;
}
 
開發者ID:starcor-company,項目名稱:starcor.xul,代碼行數:18,代碼來源:XulRenderContext.java

示例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;
}
 
開發者ID:starcor-company,項目名稱:starcor.xul,代碼行數:19,代碼來源:XulRenderContext.java

示例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;
}
 
開發者ID:hichemcesar24,項目名稱:Weather-Android,代碼行數:16,代碼來源:AbstractWidgetProvider.java

示例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);
    }
}
 
開發者ID:newbiechen1024,項目名稱:NovelReader,代碼行數:38,代碼來源:PageLoader.java

示例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); 
}
 
開發者ID:fcatrin,項目名稱:retroxlibs,代碼行數:10,代碼來源:ExtraButtonsView.java

示例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);
}
 
開發者ID:worldiety,項目名稱:homunculus,代碼行數:12,代碼來源:MaterialFontView.java

示例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();
    }
 
開發者ID:AnliaLee,項目名稱:BookPage,代碼行數:60,代碼來源:BookPageView.java


注:本文中的android.graphics.Paint.setSubpixelText方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。