Getting Image from Web - Java

Hello all, I was making an extension which is a barcode generator. I have an API from which I get the image, but my question is how to get that image in an exension?

Can someone help?

Thank you...

Can anyone reply

Nobody knows the answer :thinking:

Take it easy, if someone knows the answer, he will answer ...

2 Likes

there are too many people already make it.
and I think it can be made without using extension






I wanted to learn how to do it...

I am sure that api will return url of that image so just return the string.

I didnt understand :thinking:

Show your code and api you are using.

   @SimpleFunction (description = "Can create customisable barcode.")
  public String Customisable ( String codeType, String text, int foregroundColor, int backgroundColor )
  {
    return "https://barcode.tec-it.com/barcode.ashx?data=" + text + "&code=" + codeType + "&multiplebarcodes=false&translate-esc=false&unit=Fit&dpi=96&imagetype=Gif&rotation=0&color=%" + foregroundColor + "&bgcolor=%" + backgroundColor + "&codepage=Default&qunit=Mm&quiet=0";
  }

This is the code I have kept. Is there any problem.

I see your code and I think your code don't has any problem

But it is only returning the text not image

yeah it will return txt, but if you try to put that text in a imageview it will become an image

3 Likes

You can't return image from your code.

1 Like

I finally found a solution to the problem. :sweat_smile:

please provide the answer to your question then, so others can learn from it...
this is the purpose of a community...
thank you

Taifun

2 Likes

I just returned the url from the extension then it worked

It's nice that you have found a solution that others have previously suggested and instead of leaving the word "solution" there you set it on your post that says nothing ...

1 Like

which means, the suggestion from @vknow360 is the solution to your issue
I set that thread as solution now

Taifun

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.