[SDL] Search function to display picture got with libcurl
Damien Fawks
damien_fawks at hotmail.com
Sun Jun 24 13:54:01 PDT 2007
Ok, many thanks for everything it works great now. I used getinmemory.c example code for that.
_________________________________________________________
I took a look at the curl documentation and we are both correct in our
assumptions.
If you look at the sample "getinmemory.c" in the docs\examples folder you
will see the proper way to do what you want. The thing you are missing is
the writedata callback.
After you modify your code you have two choices on the image.
1) You can keep the code to create and show the image in your writefunction
call back (but use the mem->memory pointer instead of the current block
memory pointer. This will allow you to show progressive gets of the data as
a single large image. If you do this make sure you delete your SDL surface
when you re-enter the function.
2) You can just create and display the data after the call to
curl_easy_perform() with the chunk.memory pointer. This will have all of
the data for the entire image. Simplier of the two approaches.
I have attached the getinmemory.c file in case you don't have access to it.
Ken Rogoway
Homebrew Software
http://www.homebrewsoftware.com/
_________________________________________________________________
Windows Live Messenger vous offre 30 nouvelles émoticônes gratuites, installées directement dans votre Messenger !
http://www.emoticones-messenger.fr/
More information about the SDL
mailing list