android-image

Timestamp of generated bitmap - Android

牧云@^-^@ 提交于 2019-12-05 22:30:57
I have an app where I have downloaded an image file from the web and I save this file in external storage. Later, to add this image to the media store, I call: MediaStore.Images.Media.insertImage(getContentResolver(), fullPath, "IMG_"+System.currentTimeMillis(),null); However, my picture always adds to the end of the gallery - it thinks that the picture was taken in 1970. How do I change this information? Thanks! Worked using JPEGS (not PNG!) with ExifInterface 来源: https://stackoverflow.com/questions/12180934/timestamp-of-generated-bitmap-android

How to filter out unwanted files using Intent.ACTION_GET_CONTENT

*爱你&永不变心* 提交于 2019-12-05 18:52:53
I'm using intent.ACTION_GET_CONTENT to allow a user to select images or video files only. this is the way am preparing my intent Intent intent = new Intent(Intent.ACTION_GET_CONTENT); intent.setType("image/* | video/*"); intent.putExtra(Intent.EXTRA_LOCAL_ONLY, true); intent.addCategory(Intent.CATEGORY_OPENABLE); XActivity.startActivityForResult(intent, ACQUIRE_IMAGE_AND_VIDEOS_CODE); When i click the button that start this intent, the following apps are display in my customized dialog below is the method that fills my dialog with apps that can handle the above intent and also what happens

Enlarging an Imageview on click

青春壹個敷衍的年華 提交于 2019-12-05 18:30:34
Hello Stackoverflow friendo's. I'm just wondering if someone can assist me. I've created an app which holds a lot of images, the images are currently pretty small but I want them to expand once they're clicked. Is there any way of doing this? My app holds about 50 xml and the same in classes. But it holds about 100 images, is there any simple way to do this? An example of my XML <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="match_parent" android:background="#808080"

Can Eclipse automatically generate different DPI images for Android projects?

眉间皱痕 提交于 2019-12-05 18:18:34
I'm trying to import a 600x600 PNG I made into my Android project so that I can use it as a full-sized image in an Activity. Dragging and dropping it onto my /res folder just puts it in that folder, which of course generates an "invalid resource directory name" error. I can drop it into any of the /res/drawable folders and that works fine, except then it's only in that one folder. Surely, there's an inbuilt tool which can take my image and scale it appropriately for each /res/drawable folder. AFAIK there isn't. What you can do though, is use the drawable-xhdpi folder only. Android will

Android - How to show images from resources drawable?

最后都变了- 提交于 2019-12-05 16:56:56
问题 I'm not able to show an image which is saved in res/drawable folder. I use ImageGetter to do this. The code is below: ImageGetter imageGetter3 = new ImageGetter() { public Drawable getDrawable(String source) { int id=0; if (source.equals("smiley")) { id = R.drawable.smiley; } Drawable d = getResources().getDrawable(id); d.setBounds(0, 0, d.getIntrinsicWidth(), d.getIntrinsicHeight()); return d; } }; directions += "Je bent bij lokaal " + vertrek.getNaam() + "\n" + "Sta met je rug voor de deur

Why do we (have) to use different launcher icons (xhdpi, hdpi, etc)

ぃ、小莉子 提交于 2019-12-05 15:08:33
I was wondering, why are we using different launcher icons (sizes) in android. Currently you "have" to resize your icon to: LDPI - 36 x 36 MDPI - 48 x 48 HDPI - 72 x 72 XHDPI - 96 x 96 And put them in the desired folder. But does it really matter if you would only put a xhdpi icon in your android application, and if you just leave the ldpi, mdpi and hdpi folder empty. If you try the app with this configuration (only a xhdpi icon) on a mdpi device, automatically the xhdpi icon is used (I assume the device scales the icon automatically), and it looks just normal. So what would stop us from only

Custom ListView with many images gets Out Of Memory Exception

☆樱花仙子☆ 提交于 2019-12-05 13:05:03
I'm trying to create an Android ListView that will look like Instagram pictures feed or Facebook's. I'm getting Out Of Memory Exception on my Galaxy Nexus after loading some images (only a few). I scaled them, but still, the number of images isn't fixed and theoretically can be unlimited. On Facebook and Instagram they load lots of images and other data and it works well. What do you think? Can i achieve those performances with native Android coding? If i'll create a HTML5 feed (like Facebook and Instagram) will i avoid the memory problem? It feels weird for me that I need to do so much work

Error No resource found that matches the given name (at 'src' with value '@drawable/button1')

纵然是瞬间 提交于 2019-12-05 12:57:04
I thought the book had incorrect code. Tried at my home location and it worked. Found out that my eclipse was actually broken. Had to remove and re install eclipse. This is my first post here so if I didn't follow some of the rules please let me know. I tried to search and found a few post with the same error but they dealt with strings. I'm following Android Apps for Absolute Beginners (2nd Edition) and on page 179 you bring button1.xml into your res/drawable. When I go in layout/activity_main.xml and input <ImageButton android:id="@+id/button_one" android:layout_width="wrap_content" android

Animate image's saturation

风格不统一 提交于 2019-12-05 06:03:53
Is it possible to animate the saturation of an image (e.g. png) over time? For example from grayscale to full color. Plus if I can use an Interpolator. I have seen the EffectFactory and the ColorMatrix classes but I cannot combine them with an animation/transition. E.g. applying grayscale saturation on a Drawable drawable : ColorMatrix matrix = new ColorMatrix(); matrix.setSaturation(0); ColorMatrixColorFilter filter = new ColorMatrixColorFilter(matrix); drawable.setColorFilter(filter); and for full saturation later: matrix.setSaturation(1); For anyone interested my full solution based on

Android development: how to open a .dcm file as a bitmap?

谁都会走 提交于 2019-12-05 05:33:15
问题 I'm currently trying to make an android dicom app Following code opens pictures drom res/drawable in "ussual" image formats, but it doesn't work with .dcm public class BitmapView extends View { public BitmapView(Context context) { super(context); } @Override public void onDraw(Canvas canvas) { Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.test); canvas.drawColor(Color.BLACK); canvas.drawBitmap(bmp, 10, 10, null); } } in the main activity: protected void onCreate(Bundle