AndroidImagePopup icon indicating copy to clipboard operation
AndroidImagePopup copied to clipboard

How to get image from image View

Open mustafamn opened this issue 7 years ago • 6 comments

I m setting image from gallery to image View and i m using this library to popup the image which set in image view but while clicking the image in popup it showing fully blank

so what to do to show the image..????

your reply will be more useful for me

my code : final ImagePopup imagePopup = new ImagePopup(this); imagePopup.setWindowHeight(800); // Optional imagePopup.setWindowWidth(800); // Optional imagePopup.setBackgroundColor(Color.WHITE); // Optional //imagePopup.setFullScreen(true); // Optional imagePopup.setHideCloseIcon(true); // Optional imagePopup.setImageOnClickClose(true); // Optional

    imagePopup.initiatePopup(img.getDrawable());

img.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { //openGallery(); imagePopup.viewPopup(); show

mustafamn avatar Nov 29 '18 11:11 mustafamn

did img have already drawable ?
or can you share the code before that ?

Abdelsattar avatar Nov 30 '18 21:11 Abdelsattar

no image is not in drawable i m pickup the image from gallery and set in image view and that image should popup..

and this is my code

final ImagePopup imagePopup = new ImagePopup(this); imagePopup.setWindowHeight(800); // Optional imagePopup.setWindowWidth(800); // Optional imagePopup.setBackgroundColor(Color.WHITE); // Optional imagePopup.setFullScreen(true); // Optional imagePopup.setHideCloseIcon(true); // Optional imagePopup.setImageOnClickClose(true); // Optional

imagePopup.initiatePopup(img.getDrawable());

imagePopup.viewPopup();

https://www.avast.com/en-in/recommend?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=default3&tag=16277832-0cd4-484f-8a46-b1c00fa42e20 I’m protected online with Avast Free Antivirus. Get it here — it’s free forever. https://www.avast.com/en-in/recommend?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=default3&tag=16277832-0cd4-484f-8a46-b1c00fa42e20 <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Sat, Dec 1, 2018 at 2:38 AM Mohamed Abd EL-Sattar < [email protected]> wrote:

did img have already drawable ? or can you share the code before that ?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/chathuralakmal/AndroidImagePopup/issues/34#issuecomment-443339947, or mute the thread https://github.com/notifications/unsubscribe-auth/AhiK9KwNNvboLs8noquyr2SevfG2W9soks5u0Z5JgaJpZM4Y5d1H .

mustafamn avatar Dec 04 '18 05:12 mustafamn

so where is the full code before that as you must set image to to img before make this code or you can use initiatePopupWithPicasso() with any thing // uri, string url, or file
https://github.com/chathuralakmal/AndroidImagePopup#support-using-picasso

Abdelsattar avatar Dec 04 '18 07:12 Abdelsattar

@Override public void onActivityResult(final int requestCode, int resultCode, Intent data) { try { switch (requestCode) { case IMAGE_REQUEST: if (resultCode == RESULT_OK) { //filePath1 = data.getData(); try { bitmap = (Bitmap) data.getExtras().get("data"); img.setImageBitmap(Bitmap.createScaledBitmap(bitmap, 260, 260, false));

                    } catch (Exception e) {
                        Toast.makeText(this, "Couldn't load photo", Toast.LENGTH_LONG).show();
                    }
                }
                break;
            default:
                break;
        }
    } catch (Exception e) {
        e.printStackTrace();
    }

final ImagePopup imagePopup = new ImagePopup(this); imagePopup.setWindowHeight(800); // Optional imagePopup.setWindowWidth(800); // Optional imagePopup.setBackgroundColor(Color.BLACK); // Optional //imagePopup.setFullScreen(true); // Optional imagePopup.setHideCloseIcon(true); // Optional imagePopup.setImageOnClickClose(true); // Optional

    imagePopup.initiatePopupWithPicasso(String.valueOf(img));
    //imagePopup.initiatePopupWithPicasso(String.valueOf(img.getDrawable()));

    img.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            //openGallery();
             imagePopup.viewPopup();

} });

this is the code but i m getting blank in popup

mustafamn avatar Dec 04 '18 13:12 mustafamn

no image is not in drawable im getting image from phone gallery and set in imageView while setting popup in imageView its show blank ..... i have share the code in GitHub please check out

Thank you for your reply

On Sat, Dec 1, 2018 at 2:38 AM Mohamed Abd EL-Sattar < [email protected]> wrote:

did img have already drawable ? or can you share the code before that ?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/chathuralakmal/AndroidImagePopup/issues/34#issuecomment-443339947, or mute the thread https://github.com/notifications/unsubscribe-auth/AhiK9KwNNvboLs8noquyr2SevfG2W9soks5u0Z5JgaJpZM4Y5d1H .

mustafamn avatar Dec 05 '18 05:12 mustafamn

@mustafamn can you use the Picasso in sitting the first image to img by the URI

Abdelsattar avatar Dec 05 '18 10:12 Abdelsattar