草庐IT

bitmap_image

全部标签

android - 内存不足错误 : Using a image which is 1080*1920 do the splash page

这个问题在这里已经有了答案:StrangeOutOfMemoryissuewhileloadinganimagetoaBitmapobject(44个答案)关闭7年前。我想在我的Android应用程序中实现启动页面。所以在布局xml中,有一个imageView,图像文件是一个png文件,是1080*1920,当运行应用程序时,会发生OutOfMemoryError错误,我该如何解决?XML文件:错误信息:04-1718:40:16.03829793-29793/cn.test.androidE/AndroidRuntime﹕FATALEXCEPTION:mainProcess:cn.t

音视频从入门到精通——FFmpeg之av_image_get_buffer_size函数

文章目录FFmpeg之av_image_get_buffer_size函数ffmpeg的ffmpeg中的alignffmpeg的linesizeav_image_alloc函数av_image_fill_arrays函数参考FFmpeg之av_image_get_buffer_size函数/***Returnthesizeinbytesoftheamountofdatarequiredtostorean*imagewiththegivenparameters.*返回使用给定参数存储图像所需数据量的字节大小**@parampix_fmtthepixelformatoftheimage图像的像素格

Android Glide : Show a blurred image before loading actual image

我正在开发一个向用户显示全屏图像的Android应用程序。图像是从服务器获取的。我正在使用Glide来显示图像。但是我想在显示实际图像之前显示一个非常小的模糊图像。缓存图像后,应直接显示全尺寸图像。图像显示流程如下:-如果是第一次下载图片,请先下载小尺寸图片,然后再下载全分辨率图片。-如果之前下载过图片,直接显示全尺寸图片。我在Glide库中找不到任何方法,它告诉我缓存中是否存在文件。任何想法,如何做到这一点。 最佳答案 Glide.with(context.getApplicationContext()).load(YourPat

Android 模拟器错误 "emulator: ERROR: the user data image is used by another emulator. aborting"

这个问题在这里已经有了答案:关闭11年前。PossibleDuplicate:EmulatorprobleminAndroid模拟器:错误:用户数据图像被另一个模拟器使用。中止大多数时候我都遇到这个问题..我什至重新启动Eclipse..并重新启动模拟器..但问题仍然存在。为什么?

安卓 : upload Image and JSON using MultiPartEntityBuilder

我尝试将数据上传到服务器,我的数据包含多个图像和大型JSON,在此之前,我尝试使用base64将图像转换为字符串发送并发送我以前用JSON转换过的另一个数据和图像,但我在这里遇到问题OutOfMemory,所以我读了一个解决方案,说我必须尝试使用​​MultipartEntityBuilder。我仍然感到困惑,不明白如何使用MultiPartEntityBuilder来实现,有没有人可以帮助我使用MultiPartEntityBuilder来实现?这是我的代码:try{//membuatHttpClient//membuatHttpPostHttpPosthttpPost=newHtt

android - 从 WebView 获取 Bitmap 产生 OutOfMemory 崩溃

我有一个自定义的WebView,我想获取其内容的位图(包括离屏)。我使用了这段代码,它是从here获得的:publicstaticBitmapgetBitmapFromWebviewV2(WebViewwebView){webView.measure(View.MeasureSpec.makeMeasureSpec(View.MeasureSpec.UNSPECIFIED,View.MeasureSpec.UNSPECIFIED),View.MeasureSpec.makeMeasureSpec(0,View.MeasureSpec.UNSPECIFIED));webView.layo

android - 通过 Intent with Image (Photo) 插入联系人 (ContactsContract)

有很多问答帖,但没有一个提供真正的答案,或者我找不到。为了确保您的安全,我在询问之前进行了搜索:Android:setcontactphotowithContactsContractinsertintent(无效答案)InsertcontactinAndroidwithContactsContract(接受的答案不使用Intent)Insertanewcontactintent(不触及问题)Howtoinsertphotoincallintent?(不相关)Addaphototoacontact(不使用Intent)https://stackoverflow.com/a/8574396

android - MediaStore.Images.Media.getBitmap 和内存不足错误

我的代码代码是:publicBitmaploadPhoto(Uriuri){Bitmapscaled=null;try{scalled=Bitmap.createBitmap(MediaStore.Images.Media.getBitmap(getContentResolver(),uri),0,0,90,90);if(scaled==null){returnnull;}}catch(Exceptione){}returnscaled;}在此之后。我在ImageView中显示缩放。每张图片都来自设备相机。每次显示相机中的三张照片后,我都会收到错误消息:内存不足。如何解决?

android - 使用后是否需要调用 Bitmap.recycle() (在Android中)?

根据Bitmap.recycle()的Android引用文档:Freethenativeobjectassociatedwiththisbitmap,andclearthereferencetothepixeldata.Thiswillnotfreethepixeldatasynchronously;itsimplyallowsittobegarbagecollectediftherearenootherreferences.Thebitmapismarkedas"dead",meaningitwillthrowanexceptionifgetPixels()orsetPixels()

安卓工作室 : Ice Cream Sandwich (API Level 15) Device Configuration not showing up even though system image is installed

我正在尝试在IceCreamSandwich设备上测试应用。为此,我希望在运行API级别15的androidstudio中运行模拟器。我已确保通过sdk管理器安装系统镜像,它在管理器中正确显示为已安装,如下所示:不幸的是,当我尝试从虚拟设备配置菜单的列表中选择系统镜像时,该选项没有显示。我试着在网上查了一下,但解决方案似乎很不正统。有没有人遇到过这个问题并找到了解决方案? 最佳答案 我认为这是一个错误。这是一个解决方法。下载API级别15Intelx86Atom系统镜像后,执行以下操作。转到独立SDK管理器。选择菜单项工具->管理A