문제

I have an image view in my app. when I try to make it show a jpg file exported from 3ds max, it works. But if it comes from Photoshop, it just does nothing. Why is that? If it is at all important my app gets the image from my server with the following code:

public static Bitmap getWebImage(String URL)
{
    URL myImageURL = null;

    Bitmap bitmap = null;

    try {

        myImageURL = new URL(URL);

        } catch (MalformedURLException error) {


        error.printStackTrace();

        }
        try {

            HttpURLConnection connection = (HttpURLConnection)myImageURL .openConnection();

            connection.setDoInput(true);

            connection.connect();

            InputStream input = connection.getInputStream();

            bitmap = BitmapFactory.decodeStream(input);

            } catch (IOException e) {


            e.printStackTrace();

            }

            return bitmap;

}
도움이 되었습니까?

해결책

Would it be possible for you to upload the two pictures for comparison?

다른 팁

Can you check the color settings of your JPG files? Most likely your JPG files from photoshop is in CMYK rather than RGB, and Android simply doesn't support CMYK.

public static Bitmap getWebImage(String URL) { URL myImageURL = null;

Bitmap bitmap = null;

try {

myImageURL = new URL(URL);

} catch (MalformedURLException error) {

error.printStackTrace();

} try {

HttpURLConnection connection = (HttpURLConnection)myImageURL .openConnection();

connection.setDoInput(true);

connection.connect();

InputStream input = connection.getInputStream();

bitmap = BitmapFactory.decodeStream(input);

} catch (IOException e) {

e.printStackTrace();

}

return bitmap;

}

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top