本文整理了Java中android.widget.ImageView.getDrawingCache()
方法的一些代码示例,展示了ImageView.getDrawingCache()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ImageView.getDrawingCache()
方法的具体详情如下:
包路径:android.widget.ImageView
类名称:ImageView
方法名:getDrawingCache
暂无
代码示例来源:origin: fossasia/pslab-android
Bitmap clickSpot = Bitmap.createBitmap(colorMap.getDrawingCache());
colorMap.setDrawingCacheEnabled(false);
try {
代码示例来源:origin: behindeye/WxPhoneNumberHelper
public void clearAllStatus() {
Bitmap drawingCache = mIvIcon.getDrawingCache();
if (drawingCache != null) {
drawingCache.recycle();
}
mIvIcon.setImageBitmap(null);
mIvIcon.setVisibility(View.GONE);
mBtnChoose.setVisibility(View.VISIBLE);
mImageUriList.clear();
mEtGroupTitle.setText("");
mEtGroupWxNumber.setText("");
mEtGroupIntroduce.setText("");
}
}
代码示例来源:origin: SwiftyWang/FingerColoring-Android
public Bitmap getVisibleRectangleBitmap() {
ImageView imageView = getImageView();
return imageView == null ? null : imageView.getDrawingCache();
}
代码示例来源:origin: Meiqia/MeiqiaSDK-Android
public Bitmap getVisibleRectangleBitmap() {
ImageView imageView = getImageView();
return imageView == null ? null : imageView.getDrawingCache();
}
代码示例来源:origin: MukeshKumar009/EcomSample
public Bitmap getVisibleRectangleBitmap() {
ImageView imageView = getImageView();
return imageView == null ? null : imageView.getDrawingCache();
}
代码示例来源:origin: albinmathew/PhotoCrop
public Bitmap getVisibleRectangleBitmap() {
ImageView imageView = getImageView();
return imageView == null ? null : imageView.getDrawingCache();
}
代码示例来源:origin: xu649526275/MyMVPDemo
public Bitmap getVisibleRectangleBitmap() {
ImageView imageView = getImageView();
return imageView == null ? null : imageView.getDrawingCache();
}
代码示例来源:origin: SuperKotlin/PictureViewer
public Bitmap getVisibleRectangleBitmap() {
ImageView imageView = getImageView();
return imageView == null ? null : imageView.getDrawingCache();
}
代码示例来源:origin: stackoverflow.com
private void drawMatrix(ImageView view){
float curScale = distCurrent/dist0;
if (curScale < 0.1){
curScale = 0.1f;
}
view.buildDrawingCache();
Bitmap originalBitmap = view.getDrawingCache();
Bitmap resizedBitmap;
int newHeight = (int) (view.getHeight() * curScale);
int newWidth = (int) (view.getWidth() * curScale);
resizedBitmap = Bitmap.createScaledBitmap(originalBitmap, newWidth, newHeight, false);
view.removeallviews();
view.setImageBitmap(resizedBitmap);
}
代码示例来源:origin: zxfnicholas/CameraSDK
private void getViewBitmap() {
cropimage.setDrawingCacheEnabled(true);
Bitmap bitmap = Bitmap.createBitmap(cropimage.getDrawingCache());
// 清缓存
cropimage.destroyDrawingCache();
int w = cropimage.getWidth();
int h = cropimage.getHeight();
//itbmp = Bitmap.createBitmap(bitmap, 0, 0, 640, 640);
itbmp = Bitmap.createBitmap(bitmap, 0, 0, w, w);
bitmap=ThumbnailUtils.extractThumbnail(bitmap, 640, 640);// 缩放图片到指定的宽高到640px
}
代码示例来源:origin: DingMouRen/DingDingMap
@Override
public boolean onMenuItemSelected(MenuItem menuItem) {
switch (menuItem.getItemId()){
case R.id.back:
onBackPressed();
break;
case R.id.img_save:
saveImageToGallery(PictureActivity.this,img.getDrawingCache());
break;
}
return true;
}
代码示例来源:origin: qiubiteme/android_api_demos
public void onClick(View view) {
try {
wallpaperManager.setBitmap(imageView.getDrawingCache());
finish();
} catch (IOException e) {
e.printStackTrace();
}
}
});
代码示例来源:origin: THEONE10211024/ApiDemos
public void onClick(View view) {
try {
wallpaperManager.setBitmap(imageView.getDrawingCache());
finish();
} catch (IOException e) {
e.printStackTrace();
}
}
});
代码示例来源:origin: mylhyl/Android-Zxing
@Override
public void onClick(View v) {
imageView.setDrawingCacheEnabled(true);//step 1
Bitmap bitmap = imageView.getDrawingCache();//step 2
//step 3 转bytes
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG, 100, baos);
DeCodeActivity.gotoActivity(MainActivity.this, baos.toByteArray());//step 4
imageView.setDrawingCacheEnabled(false);//step 5
}
});
代码示例来源:origin: microbit-foundation/microbit-blue
public int getHotspotColor (int hotspotId, int x, int y) {
ImageView img = (ImageView) findViewById(hotspotId);
img.setDrawingCacheEnabled(true);
Bitmap hotspots = Bitmap.createBitmap(img.getDrawingCache());
img.setDrawingCacheEnabled(false);
if (x >= 0 && y >= 0 && x <= hotspots.getWidth() && y <= hotspots.getHeight()) {
return hotspots.getPixel(x, y);
} else {
return 0;
}
}
代码示例来源:origin: tyhjh/JinyunEffect
@Override
public void run() {
//启用DrawingCache并创建位图
iv_bg.buildDrawingCache();
while (iv_bg.getDrawingCache() == null) {
iv_bg.buildDrawingCache();
SystemClock.sleep(10);
}
Bitmap bitmap2 = Bitmap.createBitmap(iv_bg.getDrawingCache());
bitmap2 = Bitmap.createBitmap(bitmap2, 0, jinyunView.getTop(), jinyunView.getWidth(), jinyunView.getHeight());
jinyunView.setBitmapBg(bitmap2);
iv_bg.setDrawingCacheEnabled(false);
}
}).start();
代码示例来源:origin: bxbxbai/ZhuanLan
@Override
public boolean onPreDraw() {
mSplashImage.getViewTreeObserver().removeOnPreDrawListener(this);
mSplashImage.buildDrawingCache();
blur(mSplashImage.getDrawingCache(), titleView);
return true;
}
});
代码示例来源:origin: stackoverflow.com
final ImageView tempImageView = new ImageView(getActivity());
final Bitmap tmp = BitmapFactory.decodeFile(LayoutParams.WRAP_CONTENT);
tempImageView.setImageBitmap(tmp);
tempImageView.setDrawingCacheEnabled(true);
// resize and create canvas
tempImageView.measure(MeasureSpec.makeMeasureSpec(256, MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(256, MeasureSpec.EXACTLY));
tempImageView.layout(0, 0, tempImageView.getMeasuredWidth(), tempImageView.getMeasuredHeight());
tempImageView.buildDrawingCache(true);
final Bitmap resized_bm = Bitmap.createBitmap(tempImageView.getDrawingCache());
tempImageView.setDrawingCacheEnabled(false);
代码示例来源:origin: JustinRoom/CameraMaskDemo
private void showCameraLensRectBitmap() {
ivBackground.setDrawingCacheEnabled(true);
Bitmap bitmap = ivBackground.getDrawingCache(true);
bitmap = cameraLensView.cropCameraLensRectBitmap(bitmap, false);
ImageView imageView = new ImageView(getContext());
imageView.setImageBitmap(bitmap);
BottomShowDialog dialog = new BottomShowDialog(getContext());
dialog.setTitle("ShowBitmapInCameraLensRect");
dialog.setBitmap(bitmap);
dialog.show();
}
}
代码示例来源:origin: blurpy/kouchat-android
private int getColorFromPreviewImage(final ImageView previewImage) {
previewImage.buildDrawingCache();
final Bitmap drawingCache = previewImage.getDrawingCache();
final int pixelColor = drawingCache.getPixel(10, 10);
previewImage.destroyDrawingCache();
return pixelColor;
}
内容来源于网络,如有侵权,请联系作者删除!