• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • JavaScript
  • ASP.NET
  • PHP
  • 正则表达式
  • AJAX
  • JSP
  • ASP
  • Flex
  • XML
  • 编程技巧
  • Android
  • swift
  • C#教程
  • vb
  • vb.net
  • C语言
  • Java
  • Delphi
  • 易语言
  • vc/mfc
  • 嵌入式开发
  • 游戏开发
  • ios
  • 编程问答
  • 汇编语言
  • 微信小程序
  • 数据结构
  • OpenGL
  • 架构设计
  • qt
  • 微信公众号
您的位置:首页 > 程序设计 >Android > 53.Android Canvas Paint相关内容介绍

53.Android Canvas Paint相关内容介绍

作者:网友 字体:[增加 减小] 来源:互联网 时间:2017-05-26

网友通过本文主要向大家介绍了canvas paint,canvas paintcanvas,android canvas,android canvas详解,android canvas画图等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com

53.Android Canvas Paint相关内容介绍


Android Canvas Paint

 </div>

Canvas

裁剪画布:

Region.Op.INTERSECT 取两者交集,默认的方式 Region.Op.DIFFERENCE 第一次上减去与第而次的交集 Region.Op.REPLACE 显示第二次的 Region.Op.REVERSE_DIFFERENCE 第二次上减去与第一次的交集 Region.Op.UNION 取全集 Region.Op.XOR 取补集,就是全集的减去交集的剩余部分显示

clipPath(Path path)

clipPath(Path path, Region.Op op)

clipRect(Rect rect, Region.Op op)

clipRect(RectF rect, Region.Op op)

clipRect(int left, int top, int right, int bottom)

clipRect(float left, float top, float right, float bottom)

clipRect(RectF rect)

clipRect(float left, float top, float right, float bottom, Region.Op op)

clipRect(Rect rect)

clipRegion(Region region)

clipRegion(Region region, Region.Op op)

变换矩阵:

concat(Matrix matrix)

绘制圆弧

drawArc(RectF oval, float startAngle, float sweepAngle, boolean useCenter, Paint paint)

drawArc(float left, float top, float right, float bottom, float startAngle, float sweepAngle, boolean useCenter, Paint paint)

绘制Bitmap

drawBitmap(int[] colors, int offset, int stride, float x, float y, int width, int height, boolean hasAlpha, Paint paint)

drawBitmap(Bitmap bitmap, Matrix matrix, Paint paint)

drawBitmap(int[] colors, int offset, int stride, int x, int y, int width, int height, boolean hasAlpha, Paint paint)

drawBitmap(Bitmap bitmap, Rect src, RectF dst, Paint paint)

drawBitmap(Bitmap bitmap, float left, float top, Paint paint)

drawBitmap(Bitmap bitmap, Rect src, Rect dst, Paint paint)

绘制扭曲Bitmap

drawBitmapMesh(Bitmap bitmap, int meshWidth, int meshHeight, float[] verts, int vertOffset, int[] colors, int colorOffset, Paint paint)

绘制圆形

drawCircle(float cx, float cy, float radius, Paint paint)

绘制背景

drawARGB(int a, int r, int g, int b)

drawColor(int color)

drawColor(int color, PorterDuff.Mode mode)

drawPaint(Paint paint)

drawRGB(int r, int g, int b)

绘制线条

drawLine(float startX, float startY, float stopX, float stopY, Paint paint)

drawLines(float[] pts, Paint paint)

drawLines(float[] pts, int offset, int count, Paint paint)

绘制椭圆

drawOval(float left, float top, float right, float bottom, Paint paint)

drawOval(RectF oval, Paint paint)

绘制路径,可画任意多边形

drawPath(Path path, Paint paint)

绘制图片

drawPicture(Picture picture, RectF dst)

drawPicture(Picture picture)

drawPicture(Picture picture, Rect dst)

绘制点

drawPoint(float x, float y, Paint paint)

drawPoints(float[] pts, int offset, int count, Paint paint)

drawPoints(float[] pts, Paint paint)

绘制文字,可指定每个文字的位置

drawPosText(char[] text, int index, int count, float[] pos, Paint paint)

drawPosText(String text, float[] pos, Paint paint)

绘制矩形

drawRect(float left, float top, float right, float bottom, Paint paint)

drawRect(RectF rect, Paint paint)

drawRect(Rect r, Paint paint)

绘制圆角矩形

drawRoundRect(float left, float top, float right, float bottom, float rx, float ry, Paint paint)

drawRoundRect(RectF rect, float rx, float ry, Paint paint)

绘制文字

drawText(String text, float x, float y, Paint paint)

drawText(CharSequence text, int start, int end, float x, float y, Paint paint)

drawText(char[] text, int index, int count, float x, float y, Paint paint)

drawText(String text, int start, int end, float x, float y, Paint paint)

绘制在路径上的文字

drawTextOnPath(String text, Path path, float hOffset, float vOffset, Paint paint)

drawTextOnPath(char[] text, int index, int count, Path path, float hOffset, float vOffset, Paint paint)

绘制文字具体位置和大小

drawTextRun(CharSequence text, int start, int end, int contextStart, int contextEnd, float x, float y, boolean isRtl, Paint paint)

drawTextRun(char[] text, int index, int count, int contextIndex, int contextCount, float x, float y, boolean isRtl, Paint paint)

绘制顶点数据,也可绘制扭曲图片

drawVertices(Canvas.VertexMode mode, int vertexCount, float[] verts, int vertOffset, float[] texs, int texOffset, int[] colors, int colorOffset, short[] indices, int indexOffset, int indexCount, Paint paint)

获取Canvas上截取的矩形

getClipBounds()

getClipBounds(Rect bounds)

获取Canvas画布像素密度

getDensity()

获取画布过滤器

getDrawFilter()

获取画布宽高

getHeight()

getWidth()

获取画布的矩阵

getMatrix(Matrix ctm)

getMatrix()

获取Bitmap绘制画布上允许的最大高度和宽度

getMaximumBitmapHeight()

getMaximumBitmapWidth()

获取画布上的私有堆栈状态的矩阵或截图个数

getSaveCount()

是否硬件加速

isHardwareAccelerated()

不透明?

isOpaque()

保存当前画布状态,妙用将是神技

save()

save(int saveFlags)

类似save(),在现在的层上新建一层,调用restore后回复原状态

saveLayer(RectF bounds, Paint paint, int saveFlags)

saveLayer(RectF bounds, Paint paint)

saveLayer(float left, float top, float right, float bottom, Paint paint)

saveLayer(float left, float top, float right, float bottom, Paint paint, int saveFlags)

saveLayerAlpha(RectF bounds, int alpha, int saveFlags)

saveLayerAlpha(RectF bounds, int alpha)

saveLayerAlpha(float left, float top, float right, float bottom, int alpha, int saveFlags)

saveLayerAlpha(float left, float top, float right, float bottom, int alpha)

取回上次save时候的状态

restore()

restoreToCount(int saveCount)

画布翻转

translate(float dx, float dy)

画布旋转

rotate(float degrees)

rotate(float degrees, float px, float py)

画布缩放

scale(float sx, float sy)

scale(float sx, float sy, float px, float py)

Bitmap创建画布

setBitmap(Bitmap bitmap)

设置画布像

分享到:QQ空间新浪微博腾讯微博微信百度贴吧QQ好友复制网址打印

您可能想查找下面的文章:

  • 安卓中Paint类和Canvas类的方法汇总,安卓中canvas
  • 53.Android Canvas Paint相关内容介绍

相关文章

  • 2017-05-26Linux文件和目录权限详细讲解,linux权限讲解
  • 2017-05-26Amazon Alexa登录授权(Android),amazonandroid
  • 2017-05-26Apk去掉签名以及重新签名的方法,apk去掉签名
  • 2017-05-26菜鸟新闻2--设置沉浸式状态栏,新闻2--沉浸状态栏
  • 2017-05-26Xamarin.Forms+Prism(2)—— 基本使用 NavigationService,xamarin.forms
  • 2017-05-26通过redhat crash utility从ramdump中获取ftrace log
  • 2017-05-26热修复,android热修复
  • 2017-05-26Android高性能ORM数据库DBFlow入门,ormdbflow
  • 2017-05-26Android:让WebView支持&lt;input type=”file”…&gt;元素,androidwebview
  • 2017-05-26Android定位&amp;地图&amp;导航——自定义公交路线代码,android定位城市

文章分类

  • JavaScript
  • ASP.NET
  • PHP
  • 正则表达式
  • AJAX
  • JSP
  • ASP
  • Flex
  • XML
  • 编程技巧
  • Android
  • swift
  • C#教程
  • vb
  • vb.net
  • C语言
  • Java
  • Delphi
  • 易语言
  • vc/mfc
  • 嵌入式开发
  • 游戏开发
  • ios
  • 编程问答
  • 汇编语言
  • 微信小程序
  • 数据结构
  • OpenGL
  • 架构设计
  • qt
  • 微信公众号

最近更新的内容

    • Android开发之ActionBar,androidactionbar
    • Unity Android 真机调试,unityandroid
    • DB2_Tips_Tricks_04 远程数据库之间复制数据
    • [android] 数据的异步加载和图片保存,
    • 厌烦了写findViewById 试试ButterKnife吧,butterknife
    • 移动端web头部header通用写法
    • [android] 手机卫士接收短信指令执行相应操作,android接收短信
    • Android Studio混淆打包错误
    • Android学习笔记(30):选项卡TabHost浅析
    • Android源码装饰模式---ContextWrapper

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有