Package android.graphics

Examples of android.graphics.Paint


                            new Rect(
                                (g.getBitmapWidth() - rgb.getWidth())/2,
                                (g.getBitmapHeight() - rgb.getHeight())/2,
                                rgb.getWidth(),
                                rgb.getHeight()),
                            new Paint());
                } else {
                    RgbImage rgb = (RgbImage) rs.Front();
                    g.drawARGB(0, 255, 0, 0); // red
                    g.drawBitmap(
                            RgbImageAndroid.toBitmap(rgb),
                            new Rect(0, 0, rgb.getWidth(), rgb.getHeight()),
                            new Rect(
                                (g.getBitmapWidth() - rgb.getWidth())/2,
                                (g.getBitmapHeight() - rgb.getHeight())/2,
                                rgb.getWidth(),
                                rgb.getHeight()),
                            new Paint());
                }
             }
        }
    }
View Full Code Here


  }
 
  public void onDraw(Canvas canvas) {
    super.onDraw(canvas);
    if (this.boolShowX && this.vR.size() == 0) {
      Paint p = new Paint();
      p.setColor(Color.RED);
      canvas.drawLine(0, 0, this.getWidth(), this.getHeight(), p);
      canvas.drawLine(0, this.getHeight(), this.getWidth(), 0, p);
      return;
    }
    if (this.rectCurrent != null) {
      Paint p = new Paint();
      p.setColor(Color.YELLOW);
      p.setStyle(Style.STROKE);
      canvas.drawRect(this.rectCurrent, p);     
    }
    for (Enumeration<Rect> e = this.vR.elements();e.hasMoreElements();) {
      Rect r = e.nextElement();
      Paint p = new Paint();
      p.setColor(Color.GREEN);
      p.setStyle(Style.STROKE);
      canvas.drawRect(r, p);
    }
  }
View Full Code Here

        cvClearMemStorage(storage);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        Paint paint = new Paint();
        paint.setColor(Color.RED);
        paint.setTextSize(20);

        String s = "FacePreview - This side up.";
        float textWidth = paint.measureText(s);
        canvas.drawText(s, (getWidth()-textWidth)/2, 20, paint);

        if (faces != null) {
            paint.setStrokeWidth(2);
            paint.setStyle(Paint.Style.STROKE);
            float scaleX = (float)getWidth()/grayImage.width();
            float scaleY = (float)getHeight()/grayImage.height();
            int total = faces.total();
            for (int i = 0; i < total; i++) {
                CvRect r = new CvRect(cvGetSeqElem(faces, i));
View Full Code Here

        lImgView.setLayoutParams(new Gallery.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
        lImgView.setImageBitmap(lBmp);
        lImgView.setScaleType(ImageView.ScaleType.CENTER);
        lImgView.setPadding(0, 0, 0, 0);

        final Paint bck = new Paint();
        bck.setARGB(0xff, 0x80, 0x80, 0x80);
        lCanvas.drawRect(0, 0, width, height, bck);

        final Paint p = new Paint();
        p.setARGB(0xff, 0xff, 0x00, 0xff);
 
        mLinearLayout.addView(lImgView);
        setContentView(mLinearLayout);

        lImgView.setOnTouchListener(new OnTouchListener() {
View Full Code Here

TOP

Related Classes of android.graphics.Paint

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.