Am having trouble figuring out how to load an image from a URL into a TImage control.
Broadly, this is what I need to do
TMemoryStream *str = new TMemoryStream;
http->Get("http://myurl.mydomain.com/myimage.jpg", str);
The problem seems to be that str has no space allocated to it. And I get an "Invalid IO handle error".
I cannot find out the size of the image before hand.
How should I do this, please? I tried to allocate 10MB of space to TMemoryStream by creating a dummy file and loading that file into the TMemoryStream but that also throws an "Invalid IO Handler" error.
Using C++ Builder on RAD Studio XE7 to develop iOS and Android apps.
Thanks a lot
Iyer