先介紹一下 Paint 的一些常用的方法

Paint(畫筆):

void  setARGB(int a, int r, int g, int b)  

  設定Paint的顏色,參數aalpha也就是不透明度

void  setAlpha(int a)  

  設定alpha不透明度,範圍為0~255

void  setAntiAlias(booleanaa)  

  是否抗鋸齒


setDither(true) //防抖動

 

setStrokeJoin(Paint.Join.ROUND);//設定結合處,Paint.Join.Miter結合處為銳角,Paint.Join.Round結合處為銳角,Paint.Join.Bevel結合處為直線

 

void  setColor(int color)  

  設定顏色

void  setFakeBoldText(booleanfakeBoldText)  

  設定為粗體文本

void  setStrokeWidth(float width)

  設定畫筆外框寬度

voidsetStyle(Paint.Style style)

  設定畫筆的形式(空心或實心)

PathEffect  setPathEffect(PathEffect effect)  

  設定路徑效果

Shader  setShader(Shadershader)  

  設定陰影

void  setTextAlign(Paint.Align align) 

  設定文本對齊

void  setTextScaleX(float scaleX)  

  設定文本縮放倍數,1.0f為原始參數

void  setTextSize(float textSize)  

  設定字體大小

Typeface  setTypeface(Typeface typeface)  

  設定字體,Typeface包含了字體的類型,粗細,還有傾斜、顏色等。

void  setUnderlineText(booleanunderlineText)  

  設定下划線





arrow
arrow
    文章標籤
    paint
    全站熱搜

    cookiesp 發表在 痞客邦 留言(0) 人氣()