0

Probably a wasted question, but better to ask than just guessing.

If i want to turn my array back to an image, what is faster.

Image myimage = byteArrayToImage(myarray);

public Image byteArrayToImage(byte[] byteArrayIn)
{
    MemoryStream ms = new MemoryStream(byteArrayIn);
    Image returnImage = Image.FromStream(ms);
    return returnImage;
}

or

MemoryStream ms = new MemoryStream(myarray);
Image myimage = Image.GetFromStream(ms);

As both are doing the same thing, i guess they are at the same speed. But i am wondering if using a function will slow it down as it must return the variable, and such.

4

0 回答 0