zoukankan      html  css  js  c++  java
  • Android 画个圆 淡入淡出

     private class SimpleView extends ImageView{  
            int point_x;  
            int point_y;  
            int radius = 0;  
            public SimpleView(Context context) {  
                super(context);  
                // TODO Auto-generated constructor stub  
            }  
            @Override  
            public boolean onTouchEvent(MotionEvent event) {  
                point_x = (int) event.getX();//获取点击位置  
                point_y = (int) event.getY();  
                if (event.getAction() == MotionEvent.ACTION_UP) {  
                    upFlag = true;  
                }  
                invalidate();  
                return true;  
            };  
              
            protected void onDraw(android.graphics.Canvas canvas) {  
                alpha -= 3;  
                canvas.drawColor(Color.BLUE);   //设置背景色  
                Paint paint = new Paint();  
                paint.setColor(Color.WHITE);        //设置画笔颜色  
                paint.setAlpha(alpha);          //设置透明度  
                paint.setStyle(Paint.Style.FILL);  
                paint.setAntiAlias(true);  
                if (upFlag) {  
                    ++radius;  
                    if (radius > 26) {  
                        upFlag = false;  
                        radius = 0;  
                        alpha = 255;  
                    }  
                    if (radius == 18) {  
                        alpha = 100;  
                    }  
                    canvas.drawCircle(point_x, point_y, radius, paint); //画圆  
                    invalidate();  
                }  
            }  
        } 
    

      转载至:http://blog.csdn.net/walker02/article/details/7254829

  • 相关阅读:
    chr(9) chr(10) chr(13) chr(32)
    分割字符串
    日期提取函数EXTRACT
    数据泵在本地导出数据到远程数据库中
    CEIL与FLOOR
    GROUPING SETS与GROUP_ID
    LISTAGG
    AVG
    COUNT
    Scala 泛型类型和方法
  • 原文地址:https://www.cnblogs.com/gfqFighting/p/3838001.html
Copyright © 2011-2022 走看看