Unity 4.6: How to fit center byte array png in the Image UI?

I’m creating a dynamic IAB panel that all IAB data come form server, image data receive as byte array that is png file and I set it into the Image UI but the problem is my image cropped in the Image control. The code I’m using is:

public Image buyItemImage;
// the RectTrasform of Image control
public RectTransform buyItemImageRectTrasform;

Sprite sprite = getImageAsset((int)buyItemImageRectTrasform.rect.width, (int)buyItemImageRectTrasform.rect.height);
    buyItemImage.sprite = sprite;

public Sprite getImageAsset(int width, int height)
{
    Texture2D texture2D = new Texture2D(width, height);
    texture2D.LoadImage(imageAsset);
    Sprite sprite = Sprite.Create(texture2D, new Rect(0, 0, texture2D.width, texture2D.height), new Vector2(0.5f, 0.5f));
    return sprite;
}

44065-ui.png

After a couple of days searching I found the solution is that I must set the TextureFormat inside the constructor of Texture2D class.

 Texture2D texture2D = new Texture2D(2, 2, TextureFormat.Alpha8, false);
 texture2D.LoadImage(ImageAsseet);
 Sprite sprite = Sprite.Create(texture2D, new Rect(0, 0, texture2D.width,texture2D.height), new Vector2(0.5f, 0.5f));
    return sprite;