第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

mPhoto.setImageBitmap(mPhotoImage);

這個mPhotoImage從哪里來的 ? 代碼中找不到?

正在回答

1 回答

這個對象就是你選中的圖片,需要在onActivityResult中去給他賦值,具體代碼如下

Uri uri = data.getData();

ContentResolver cr = getContentResolver();

Cursor cursor = cr.query(uri, null, null, null, null);

String path = null;

if (cursor.moveToFirst()) {

????int index = cursor.getColumnIndex(MediaStore.Images.ImageColumns.DATA);

????path = cursor.getString(index);

}

cursor.close();

if (TextUtils.isEmpty(path)) {

return;

}

mBitmap = BitmapUtil.loadBitmap(path, true);

這個mBitmap就是課程中的mPhotoImage。最上面的data就是onActivityResult中的返回的Intent對象。

這只是將對象賦值,然后因為face++API的限制,還需要將Bitmap對象壓縮到3M以下。

0 回復 有任何疑惑可以回復我~
#1

jzoe

能否看一下你BitmaoUtil.loadBitmap()的實現(xiàn)?謝謝
2015-06-28 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消
How-old 刷臉神器
  • 參與學習       31536    人
  • 解答問題       160    個

通過第三方本課程教大家實現(xiàn)人臉識別,通過案例講解原理

進入課程

mPhoto.setImageBitmap(mPhotoImage);

我要回答 關注問題
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號