Package android.graphics

Examples of android.graphics.Bitmap


          Bitmap.Config.ARGB_8888);
    }
   
    static public void toDisplay(Context context, RgbImage rgb)
    {
      Bitmap bmp = toBitmap(rgb);
     
    }
View Full Code Here


    static public void toFile(Context context, RgbImage rgb, int nQuality, String szPath)
      throws IOException
    {
       OutputStream os = new FileOutputStream(szPath);
       try {
         Bitmap bmp = toBitmap(rgb);
         Bitmap.CompressFormat format = Bitmap.CompressFormat.JPEG;
         szPath = szPath.toLowerCase();
         if (szPath.endsWith("jpg") || szPath.endsWith("jpeg")) { //$NON-NLS-1$ //$NON-NLS-2$
           format = Bitmap.CompressFormat.JPEG;
         } else if (szPath.endsWith("png")) { //$NON-NLS-1$
           format = Bitmap.CompressFormat.PNG;
         }
         bmp.compress(format, nQuality, os);
       } finally {
         os.close();
       }
    }
View Full Code Here

    public boolean onKeyDown(int keyCode, KeyEvent msg) {
      boolean handled = false;
     
      if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER) {
        this.mPreviewThread.interrupt();
        Bitmap bmp = Bitmap.createBitmap(1280, 1024, false);
        Canvas c = new Canvas(bmp);
        this.mCamera.capture(c);
        this.mDhp.setImage(bmp);
        this.mDhp.Push();
      }
View Full Code Here

    public boolean onKeyDown(int keyCode, KeyEvent msg) {
      boolean handled = false;
     
      if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER) {
        this.mPreviewThread.interrupt();
        Bitmap bmp = Bitmap.createBitmap(1280, 1024, false);
        Canvas c = new Canvas(bmp);
        this.mCamera.capture(c);
        RgbImage inimg = RgbImageAndroid.toRgbImage(bmp);
        DetectBarcode db = new DetectBarcode(20000);
        if (!db.Push(inimg)) {
View Full Code Here

            public void run() {
              mFaceView.resetFaces();
              mFaceView.resetShowX();
              BitmapFactory.Options opt = new BitmapFactory.Options();
              opt.inSampleSize = 4;
              final Bitmap bmp = BitmapFactory.decodeByteArray(mJpegData, 0, mJpegData.length, opt);
          mFaceView.setImageBitmap(bmp);
            }
          });
         
      try {
        Thread t = new Thread() {
          public void run() {
            for (int nSample = 16; nSample >= 8 && !mFaceView.hasFaces(); nSample /= 2) {
                  BitmapFactory.Options opt = new BitmapFactory.Options();
                  opt.inSampleSize = nSample;
                  final Bitmap bmp = BitmapFactory.decodeByteArray(mJpegData, 0, mJpegData.length, opt);
              mRgbCurrent = RgbImageAndroid.toRgbImage(bmp);
                  mDhp.push(mRgbCurrent);
                    for (Enumeration<jjil.core.Rect> e = mDhp.getResult(); e.hasMoreElements();) {
                      jjil.core.Rect r = e.nextElement();
                      int nTop = (r.getTop() * mFaceView.getHeight()) / mRgbCurrent.getHeight();
View Full Code Here

        DisplayMetrics metrics = new DisplayMetrics();
        getWindowManager().getDefaultDisplay().getMetrics(metrics);
        final int width = metrics.widthPixels;
        final int height = metrics.heightPixels;

        final Bitmap lBmp = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
        final Canvas lCanvas = new Canvas(lBmp);
        final ImageView lImgView = new ImageView(this);

        lImgView.setLayoutParams(new Gallery.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
        lImgView.setImageBitmap(lBmp);
View Full Code Here

TOP

Related Classes of android.graphics.Bitmap

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.