当前位置: 首页 > news >正文

河北网站优化公司网上商城都有哪些平台

河北网站优化公司,网上商城都有哪些平台,网站建设的合同书,烟台论坛Android基于Matrix绘制PaintDrawable设置BitmapShader#xff0c;以手指触点为中心显示原图像圆图#xff0c;Kotlin#xff08;2#xff09; 在 https://zhangphil.blog.csdn.net/article/details/135374279 基础上#xff0c;增加一个功能#xff0c;当手指在上面的图片…Android基于Matrix绘制PaintDrawable设置BitmapShader以手指触点为中心显示原图像圆图Kotlin2 在 https://zhangphil.blog.csdn.net/article/details/135374279 基础上增加一个功能当手指在上面的图片上滑动时候显示滑动轨迹 import android.content.Context import android.graphics.Bitmap import android.graphics.BitmapShader import android.graphics.Canvas import android.graphics.Color import android.graphics.Matrix import android.graphics.Paint import android.graphics.Path import android.graphics.Shader.TileMode import android.graphics.drawable.BitmapDrawable import android.graphics.drawable.PaintDrawable import android.os.Bundle import android.util.AttributeSet import android.util.Log import android.view.MotionEvent import android.widget.ImageView import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.widget.AppCompatImageViewclass MainActivity : AppCompatActivity() {private var iv: MyImageView? nulloverride fun onCreate(savedInstanceState: Bundle?) {super.onCreate(savedInstanceState)setContentView(R.layout.activity_main)iv findViewById(R.id.iv)val r findViewByIdImageView(R.id.result)iv?.setTestImageView(r)} }class MyImageView : AppCompatImageView {private var mCurX 0private var mCurY 0private val mPath Path()private val mPathPaint Paint()private var mNewBmp: Bitmap? nullprivate var mSrcBmp: Bitmap? nullprivate var mIsDraw falseprivate val mRadius 300fprivate var mDrawable: PaintDrawable? nullprivate var testIV: ImageView? nullconstructor(ctx: Context, attrs: AttributeSet) : super(ctx, attrs) {mSrcBmp (drawable as BitmapDrawable).bitmapmPathPaint.style Paint.Style.STROKEmPathPaint.strokeWidth 15fmPathPaint.isAntiAlias truemPathPaint.color Color.RED}fun setTestImageView(iv: ImageView?) {testIV iv}override fun onTouchEvent(event: MotionEvent): Boolean {mCurX event.x.toInt()mCurY event.y.toInt()when (event.action) {MotionEvent.ACTION_DOWN - {Log.d(fly, 开始绘制)mPath.moveTo(event.x, event.y)mIsDraw true}MotionEvent.ACTION_MOVE - {mPath.lineTo(event.x, event.y)}MotionEvent.ACTION_UP, MotionEvent.ACTION_CANCEL - {Log.d(fly, 不需绘制)mIsDraw false//抬手后清除手指轨迹。myClear()}}invalidate()return true}private fun myClear() {//清除历史轨迹。mPath.reset()}override fun onDraw(canvas: Canvas) {super.onDraw(canvas)if (mIsDraw) {myDraw()canvas.drawPath(mPath, mPathPaint)}}private fun myDraw() {val shader BitmapShader(Bitmap.createScaledBitmap(mSrcBmp!!, this.width, this.height, true), TileMode.DECAL, TileMode.DECAL)mDrawable PaintDrawable(Color.DKGRAY)mDrawable!!.setCornerRadius(mRadius / 2) //圆角矩形如果不除2即是圆形框图。mDrawable!!.paint.shader shadermDrawable!!.setBounds(0, 0, (mRadius * 2).toInt(), (mRadius * 2).toInt())mNewBmp Bitmap.createBitmap(this.width, this.height, Bitmap.Config.ARGB_8888)val c Canvas(mNewBmp!!)c.drawColor(Color.LTGRAY) //画满底色。val matrix Matrix()matrix.setTranslate(-mCurX mRadius, -mCurY mRadius)mDrawable!!.paint.shader.setLocalMatrix(matrix)mDrawable!!.draw(c)testIV?.setImageBitmap(mNewBmp)} }?xml version1.0 encodingutf-8? LinearLayout xmlns:androidhttp://schemas.android.com/apk/res/androidxmlns:toolshttp://schemas.android.com/toolsandroid:layout_widthmatch_parentandroid:layout_heightmatch_parentandroid:backgroundandroid:color/darker_grayandroid:orientationverticaltools:context.MainActivitycom.pkg.MyImageViewandroid:idid/ivandroid:layout_widthmatch_parentandroid:layout_heightwrap_contentandroid:adjustViewBoundstrueandroid:backgrounddrawable/ic_launcher_backgroundandroid:scaleTypefitCenterandroid:srcmipmap/mypic /ImageViewandroid:idid/resultandroid:layout_widthwrap_contentandroid:layout_heightwrap_contentandroid:layout_marginTop20dpandroid:backgrounddrawable/ic_launcher_backgroundandroid:srcdrawable/ic_launcher_foreground //LinearLayout https://zhangphil.blog.csdn.net/article/details/135374279https://zhangphil.blog.csdn.net/article/details/135374279
http://www.tj-hxxt.cn/news/140284.html

相关文章:

  • 开发网站最新注册公司流程及费用
  • 如何注册网站主办者秦皇岛市城乡建设局网站
  • 竞价托管多少钱西安seo站内优化
  • 天津百度整站优化服务请问如何做网站
  • 大良营销网站建设公司网站开发职位介绍
  • 英文网站建静宁门户网站
  • 网站开发便宜大图网
  • 工信部网站备案系统影视 网站建设 新媒体
  • .中国域名的网站高端软件定制开发
  • 容易做的html5的网站做网站运营需要具备什么能力
  • 网站数据库访问win2008 网站服务器
  • 为什么做网站特效用用插件微网站建设及开发
  • 淄博网站建设优化珍云邯郸网站建设最新报价
  • wordpress显示标题和seo标题重庆seo搜索引擎优化推荐
  • 佛山网站建设咨询建筑模板厂投资多少钱
  • 班级做网站人的叫什么做网站如何防止被黑
  • 购物网站产品做促销能赚钱吗seo优化推广
  • 好看的手机端网站开发页面建站教程的优点
  • 专注于响应式网站开发30岁学编程还能找到工作吗
  • php网站开发案例教程惠州seo网络推广
  • 2018做网站前景好么分类网站建设
  • wordpress的官方网站泉州做网站的
  • 会小二也是做会议网站的全国职业生涯规划大赛官网
  • 盐城快速建设网站公司国内卖到国外的电商平台
  • 响应式企业网站开发所用的平台中国互联网协会是什么单位
  • 微信朋友圈做网站推广赚钱吗有网页设计这个专业吗
  • django网站开发实例pdf深圳华强北封闭了吗
  • 建站教程流程图公司网站建设问题
  • 微网站建设哪家好免费广告设计
  • 公司报备网站郑州竞价代运营公司