android-image

Get RGBValues of Bitmap in Android

江枫思渺然 提交于 2019-12-13 02:20:28
问题 I'm having some issues getting the RGB values of a bitmap in Android... This is what I'm doing: int[] temp = new int[width*height]; bit.getPixels(temp, 0, width, 0, 0, width, height); However, the colors don't seem to match the typical RGB values. For example, a white pixel will show up as -1, whereas the RGB value for it is 16777215. (I'm getting that value from this website: http://www.shodor.org/stella2java/rgbint.html) There's also a ton of negative values which don't seem to fit normal

Cocos2dx Android: Get data from file(assets/*) failed

天涯浪子 提交于 2019-12-13 01:54:29
问题 Where do you need to add your images in your Cocos2dx Android project (in Eclipse)? They're currently in the 'Resources' folder like what is mentioned on Ray Wenderlich's blog, but I get an error when I run it in the emulator: "get data from (assets/myFileName) failed" for each image. I also added these images to the assets folder in Eclipse, and it makes no difference. It works fine on the iOS side. Any suggestions? 回答1: I believe you need to run ./build_native.sh in your android folder

How to upload image to Parse in android?

不羁岁月 提交于 2019-12-12 10:56:54
问题 I have been able to take a picture using a camera or take from a gallery and show it in an ImageView using this code. What I need to do now is to use that picture and upload it to Parse. I have been googling here and there to do this, and I haven't found the right way to do it. Can someone please help me with this? Is it possible to upload the image from the ImageView? Thank you. protected Button mFromCamera; protected Button mFromGallery; protected ImageView mImageView; private static final

Android File Provider Illegal Argument Exception

安稳与你 提交于 2019-12-12 09:33:08
问题 I am using file provider to save photo to a given destination. I get: java.lang.IllegalArgumentException: Missing android.support.FILE_PROVIDER_PATHS meta-data while trying to open activity to capture image from camera. My manifest.xml file: <provider android:name="android.support.v4.content.FileProvider" android:authorities="com.example" android:exported="false" android:grantUriPermissions="true"> <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/paths" />

why only 1 of 10 image is load and saved in sd card

只愿长相守 提交于 2019-12-12 03:49:41
问题 I am loading 10 Images from URL's that are stored in array . only last index url is loading and saving image in SD card . here is my code : for(int j=0; j<List.size();j++) { reviewImageLink =List.get(j).get(TAG_Image).toString(); URL reviewImageURL; String name = reviewImageLink;//.substring(reviewImageLink .lastIndexOf("/") + 1,reviewImageLink.length()); try { reviewImageURL = new URL(reviewImageLink); if (!hasExternalStoragePublicPicture(name)) { isImage = false; new DownloadImageTask()

Android Dynamic Transparent Image Overlay

孤者浪人 提交于 2019-12-12 02:27:44
问题 I need to have a transparent image overlaid on top of the real image I want the user to see. The images will be stored on the SD card. I have seen many tutorials on doing this, but they always seem to fall short of just how do I get the two images displayed. Or maybe I'm just missing it. Anyway, here is my layout <merge xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/gallerylayout" android:layout_width="fill_parent" android:layout_height="fill_parent"> <ImageView

how to display group of images as string in arraylist

∥☆過路亽.° 提交于 2019-12-11 22:07:41
问题 hi i am new to android i got the image url responce from server via json in arraylist i got the arraylist string and i stored it in arraylist this is my coding: ArrayList al = new ArrayList(); al.add(message.getParameters()); here i add the responce string into array this responce is image string. the image string is url. here i want to display the images in emulator how can i accomplish this please tell me 回答1: I will give you an idea about this. Set an ImageView in your layout, then load

How to decode the image string to bitmap image from php server?

杀马特。学长 韩版系。学妹 提交于 2019-12-11 19:46:48
问题 In my application i have to select an image from gallery and set it as an profile picture. For that i have encoded the image as string and send it to the server. After getting the response from server i want to decode the string image to bitmap image.While receiving response from the server it shows the following error java.lang.IllegalArgumentException: bad base-64 at android.util.Base64.decode(Base64.java:161) at android.util.Base64.decode(Base64.java:136) at android.util.Base64.decode

Email Intent sends text file rather than image

北城余情 提交于 2019-12-11 18:25:53
问题 This the code I am using to take picture, display it, then send it in an email: private void takePicture() { Intent intent = new Intent("android.media.action.IMAGE_CAPTURE"); File photo = new File(Environment.getExternalStorageDirectory(), getIntent().getStringExtra("counter")); intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(photo)); imageUri = Uri.fromFile(photo); startActivityForResult(intent, 0); } @Override public void onActivityResult(int requestCode, int resultCode, Intent data)

OutOfMemoryError. happen on phone when using images(not big images and i use largeheap)

寵の児 提交于 2019-12-11 18:22:21
问题 i have asked a lot question here about my application. i have application on google play (js - design fashion & pattern maker). i run the application on a lot devices and none of them do error. but i have some phone that does error, the phone are run android 7.1 and they galaxy s7(not just galaxy phones). my app use a lot of images (almost 900), and i test it a lot, what can cause the OutOfMemoryRrror, it is not big image(on some phone it is work, and even on a same phone, it can work on one,