GUILayout.BeginScrollView - How to load images downloaded from http ?

I have a list of image urls downloaded from http. I just want to show these images on GUILayout.BeginScrollView. I searched About it from few days but not get any appropriate answer.

Here is my code Sample,


public void OnSuccess(object responseFromServer)
{
  File imageObj = (File)responseFromServer;
  IList imageList = imageObj.GetFileList();
  for (int i = 0; i < imageList.Count; i++)
   {
    Debug.Log ("Downloaded Image Url Is  : " + imageList*.GetUrl());*

}
}
----------
Now, I have a number of Image Urls, But how to show images of these urls on GUILayout.BeginScrollview. Thanx for any help.

1 Answer

1

Having an URL, you can use WWW class to download the resource it points to, and if it is JPG/PNG image, you can access the texture with WWW.texture. Having textures, you can then display them using for example GUI.DrawTexture.

you can also just put the texture in a Label if you want to use GUILayout.

–