zoukankan      html  css  js  c++  java
  • Paint类常用方法

     void  setARGB(int a, int r, int g, int b)  设置Paint对象颜色,参数一为alpha透明通道

    void  setAlpha(int a)  设置alpha不透明度,范围为0~255

    void  setAntiAlias(boolean aa)  //是否抗锯齿

    void  setColor(int color)  //设置颜色,这里Android内部定义的有Color类包含了一些常见颜色定义
     . 
    void  setFakeBoldText(boolean fakeBoldText)  //设置伪粗体文本
      
    void  setLinearText(boolean linearText)  //设置线性文本
     
    PathEffect  setPathEffect(PathEffect effect)  //设置路径效果
     
    Rasterizer  setRasterizer(Rasterizer rasterizer) //设置光栅化
     
    Shader  setShader(Shader shader)  //设置阴影 

    void  setTextAlign(Paint.Align align)  //设置文本对齐

    void  setTextScaleX(float scaleX)  //设置文本缩放倍数,1.0f为原始
      
    void  setTextSize(float textSize)  //设置字体大小
     
    Typeface  setTypeface(Typeface typeface)  //设置字体,Typeface包含了字体的类型,粗细,还有倾斜、颜色等。

     void  setUnderlineText(boolean underlineText)  //设置下划线


    Paint paint = new Paint();
     
           paint.setAntiAlias(true);          //防锯齿
            paint.setDither(true);            //防抖动
            paint.setStyle(Paint.Style.STROKE);          //画笔类型 STROKE空心 FILL 实心
  • 相关阅读:
    python学习笔记(7)
    python学习笔记(6)
    python学习笔记(5)
    python学习笔记(4)
    python学习笔记(3)
    python学习笔记(2)
    软件工程结对编程第二次作业
    软件工程结对编程第一次作业
    软件工程第三次作业
    答编辑问
  • 原文地址:https://www.cnblogs.com/wzfyang/p/3905685.html
Copyright © 2011-2022 走看看