Bonjour,
Merci de votre réponse. Je n'ai exploité le résultat qu'aujourd'hui (16/07/2016).
Ceci fonctionne très bien :
1 2 3 4 5 6 7 8 9 10
| UnicodeString URL = "http://192.168.1.5:8082/Paysage.png";
System::Classes::TMemoryStream* ResponseContent = new System::Classes::TMemoryStream;
IdHTTP1->Get(URL, ResponseContent); // Téléchargement de l'image
try
{Image1->Bitmap = new Fmx::Graphics::TBitmap(ResponseContent);
}
__finally
{ delete ResponseContent;
} ;
Image1->Bitmap->SaveToFile("Paysage.png"); |
Avec C++ Builder 10.1 , on est obligé de modifier :
Image1->Bitmap = new Fmx::Types::TBitmap(ResponseContent);
en
Image1->Bitmap = new Fmx::Graphics::TBitmap(ResponseContent);
Maintenant si on essaie ce code :
1 2 3 4 5 6 7 8 9 10 11 12
| UnicodeString LUrl = "http://192.168.1.5:8082/Paysage.png";
System::Classes::TMemoryStream* LStream = NULL;
try
{
LStream = new System::Classes::TMemoryStream();
Rest::Client::TDownloadURL::DownloadRawBytes(LUrl, LStream);
Image1->Bitmap->LoadFromStream(LStream);
}
__finally
{
delete LStream;
} |
On tombe sur une épouvantable erreur à l'execution (la compilation est ok) :
Erreur détaillée d'IIS 10.0 - 406.0 - not Acceptable
Je ne vois pas comment la corriger.
Si vous avez des pistes, je suis preneur.
Cordialement
Carmicahel
Partager