Aller au contenu
View in the app

A better way to browse. Learn more.

Forum de Frandroid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Comportement différent des images PNG et JPG

Featured Replies

Posté(e)

Bonjour,

Je charge des images dans mon application . Une image de même taille mais qui est une fois chargée à partir des ressources et une autre fois à partir d'une url n'a pas le même comportement.

Est ce quelqu'un a une idée ?

Merci

Modifié par loudo

Posté(e)

As-tu regardé du côté de scaleType ?

Il nous faudrait un peu plus de détail avec du code pour t'aider :o

Posté(e)
  • Auteur

Voilà le xml d'une ImageView que j'affiche dans une liste

              android:paddingLeft="5px"
              android:paddingTop="5px"
              android:paddingRight="5px"
              android:paddingBottom="5px"
              android:layout_width="fill_parent" 
              android:layout_height="fill_parent" 
              android:scaleType="centerInside"
              android:adjustViewBounds="true" />

quand j'affecte une ressource image de mon application

imageDrawable=(BitmapDrawable) ctx.getResources().getDrawable(R.drawable.temp);
image.setImageDrawable(imageDrawable);
image.setAlpha(150);

j'ai le résultat suivant : http://img72.imageshack.us/img72/96/etire.png

si par contre je télécharge une image à partir d'un serveur, je l'enregistre dans le cache du portable et ensuite je l'affiche

InputStream is = null;
BitmapFactory.Options options = new BitmapFactory.Options();
Bitmap bitmap = BitmapFactory.decodeStream(is, null, options);
BitmapDrawable drawable = new BitmapDrawable(bitmap);
image.setImageDrawable(imageDrawable);
image.setAlpha(150);

j'ai le résultat suivant : http://img100.imageshack.us/img100/5522/pasetire.png

Merci de votre aide

Archivé

Ce sujet est désormais archivé et ne peut plus recevoir de nouvelles réponses.

Account

Navigation

Rechercher

Rechercher

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.