美文网首页
Pain属性

Pain属性

作者: 小婷android | 来源:发表于2021-03-25 15:28 被阅读0次

绘制文字

  • setColor(@ColorInt int color) 设置画笔颜色
  • setStrokeWidth(float width)设置画笔粗细
  • setTextSkewX(float f)设置倾斜,负右斜,正为左
  • setARGB(int a,int r,int g,int b)设置颜色,a为透明度
  • setTextSize(float textSize) 设置文字大小
  • setFakeBoldText(boolean fakeBoldText)是否粗体
  • setTextAlign(Paint.Align align)设置文字对齐方式
    Paint.Align.LEFT 左对齐
    Paint.Align.CENTER 中心对齐,绘制从
    Paint.Align.RIGHT 右对齐
  • setUnderlineText(boolean underlineText)设置下划线
  • setStyle(Style style)设置画笔样式,FILL,STROKE,FILL_AND_STROKE
  • setTypeface(Typeface typeface)设置Typeface对象,即字体风格
    Typeface.NORMAL 默认
    Typeface.BOLD 粗体
    Typeface.ITALIC 斜体
    Typeface.BOLD_ITALIC 粗斜体
  • sheFlags(int flags)设置画笔的flag
    ANTI_ALIAS_FLAG 抗锯齿
    DITHER_FLAG 防抖动
  • setStrikeThruText (boolean strikeThruText) 设置文本删除线
  • setTextScaleX(float f) 设置缩放,0f到1f为缩小,大于1f为放大
  • getFontSpacing()得到行间距

绘制图像

  • setDither(boolean dither)设置抖动处理
  • setAlpha(int a)设置透明度
  • setAntiAlias(boolean aa)是否开启抗锯齿
  • setFilterBitmap()是否开启优化bitmap
  • setColorFilter(ColorFilter filter)设置颜色过滤
  • setMaskFilter(MaskFilter maskfilter)设置滤镜效果
  • setShader(Shader shader)设置图像渐变效果
  • setSrokeJoin(Paint.Join join)设置图像结合方式
  • setXfermode(Xfermode xfermode)设置图像重叠效果
  • setPathEffect(PathEffect effect)设置路径效果
  • reset()恢复默认设置

相关文章

网友评论

      本文标题:Pain属性

      本文链接:https://www.haomeiwen.com/subject/qpxrhltx.html