Example usage for android.graphics Bitmap toString

List of usage examples for android.graphics Bitmap toString

Introduction

In this page you can find the example usage for android.graphics Bitmap toString.

Prototype

public String toString() 

Source Link

Document

Returns a string representation of the object.

Usage

From source file:com.bf.zxd.zhuangxudai.my.fragment.FinancialApplyFragment.java

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    //??-1??/*from w  w  w.  jav a2  s. c  o  m*/
    if (resultCode != Activity.RESULT_OK) {
        return;
    }
    if (requestCode == ALL_PHOTO) {
        //
        Cursor cursor = getActivity().getContentResolver().query(data.getData(),
                new String[] { MediaStore.Images.Media.DATA }, null, null, null);
        //????
        cursor.moveToFirst();
        String path = cursor.getString(cursor.getColumnIndex(MediaStore.Images.Media.DATA));
        cursor.close();
        //?
        startPhoneZoom(Uri.fromFile(new File(path)));
    } else if (requestCode == REQUEST_CODE) {
        //?
        startPhoneZoom(Uri.fromFile(new File(path)));
    } else if (requestCode == RESULT_PHOTO) {
        //??
        Bundle bundle = data.getExtras();
        if (bundle != null) {
            Bitmap bitmap = bundle.getParcelable("data");
            //???
            // TODO: 2017/2/13 ?
            Log.e("Daniel", "---bitmap.toString()---" + bitmap.toString());
            uploadAvatars(bitmap);
            //
        }
    }
}

From source file:com.bf.zxd.zhuangxudai.my.fragment.CompanyApplyFragment.java

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    Log.i("Daniel", "---resultCode---" + resultCode);
    //??-1??/*  w w w  . j  av a 2  s  .  c o  m*/
    if (resultCode != Activity.RESULT_OK) {
        return;
    }
    if (requestCode == ALL_PHOTO) {
        //
        Cursor cursor = getActivity().getContentResolver().query(data.getData(),
                new String[] { MediaStore.Images.Media.DATA }, null, null, null);
        //????
        cursor.moveToFirst();
        String path = cursor.getString(cursor.getColumnIndex(MediaStore.Images.Media.DATA));
        Log.i("Daniel", "---path---" + path);
        cursor.close();
        //?
        startPhoneZoom(Uri.fromFile(new File(path)));
    } else if (requestCode == REQUEST_CODE) {
        //?
        startPhoneZoom(Uri.fromFile(new File(path)));
    } else if (requestCode == RESULT_PHOTO) {
        //??
        Bundle bundle = data.getExtras();
        if (bundle != null) {
            Bitmap bitmap = bundle.getParcelable("data");
            //???
            // TODO: 2017/2/13 ?
            Log.e("Daniel", "---bitmap.toString()---" + bitmap.toString());
            uploadAvatars(bitmap);
            //
        }
    }
}

From source file:org.y20k.transistor.PlayerActivityFragment.java

private void processNewImage(Uri newImageUri) {

    ImageHelper imageHelper = new ImageHelper(newImageUri, mActivity);
    Bitmap newImage = imageHelper.getInputImage();

    if (newImage != null) {
        // write image to storage
        File stationImageFile = mCollection.getStations().get(mStationID).getStationImageFile();
        try (FileOutputStream out = new FileOutputStream(stationImageFile)) {
            newImage.compress(Bitmap.CompressFormat.PNG, 100, out);
        } catch (IOException e) {
            Log.e(LOG_TAG, "Unable to save: " + newImage.toString());
        }// w  w  w .j a  v  a 2  s .  c  o m
        // change mStationImageView
        imageHelper.setBackgroundColor(R.color.transistor_grey_lighter);
        Bitmap stationImage = imageHelper.createCircularFramedImage(192);
        mStationImageView.setImageBitmap(stationImage);
    } else {
        Log.e(LOG_TAG, "Unable to get image from media picker: " + newImageUri.toString());
        // TODO handle error here
    }
}

From source file:org.y20k.transistor.MainActivityFragment.java

private void processNewImage(Uri newImageUri) {

    ImageHelper imageHelper = new ImageHelper(newImageUri, mActivity);
    Bitmap newImage = imageHelper.getInputImage();

    if (newImage != null) {
        // write image to storage
        File stationImageFile = mCollection.getStations().get(mTempStationImageID).getStationImageFile();
        try (FileOutputStream out = new FileOutputStream(stationImageFile)) {
            newImage.compress(Bitmap.CompressFormat.PNG, 100, out);
        } catch (IOException e) {
            Log.e(LOG_TAG, "Unable to save: " + newImage.toString());
        }/*from   w ww  .j  a  v  a2 s  . c  om*/
    } else {
        Log.e(LOG_TAG, "Unable to get image from media picker: " + newImageUri.toString());
        // TODO handle error here
    }
}

From source file:org.y20k.transistor.core.Station.java

public void writeImageFile(File folder, Bitmap downloadedImage, String imgFileName) {
    String fileLocation = folder.toString() + "/" + imgFileName;
    LogHelper.v(LOG_TAG, "Saving channel image : " + fileLocation.toString());
    File mStationImageFile = new File(fileLocation);
    // write image to storage
    try (FileOutputStream out = new FileOutputStream(mStationImageFile)) {
        downloadedImage.compress(Bitmap.CompressFormat.PNG, 100, out);
    } catch (IOException e) {
        LogHelper.e(LOG_TAG, "Unable to save station image: " + downloadedImage.toString());
    }/*from  ww  w  . j a  v  a  2  s  . co m*/
}

From source file:com.mylikes.likes.etchasketch.Slate.java

public void paintBitmap(Bitmap b) {
    if (mTiledCanvas == null) {
        mPendingPaintBitmap = b;/*from  www . java  2  s.com*/
        return;
    }

    commitStroke();

    Matrix m = new Matrix();
    RectF s = new RectF(0, 0, b.getWidth(), b.getHeight());
    RectF d = new RectF(0, 0, mTiledCanvas.getWidth(), mTiledCanvas.getHeight());
    m.setRectToRect(s, d, Matrix.ScaleToFit.CENTER);

    if (DEBUG) {
        Log.v(TAG, "paintBitmap: drawing new bits into current canvas");
    }
    mTiledCanvas.drawBitmap(b, m, sBitmapPaint);
    invalidate();

    if (DEBUG)
        Log.d(TAG, String.format("paintBitmap(%s, %dx%d): canvas=%s", b.toString(), b.getWidth(), b.getHeight(),
                mTiledCanvas.toString()));
}