Mega Search
23.2 Million


Sign Up

Make a donation  
Loading Image from DataSnap Server to Android App  
News Group: embarcadero.public.delphi.database.multi-tier

Im loading a imagen into a Timage on my Android App,

I have:

XE5

DataSnap Server

App Android Client

if the image is like (40KB, 200x200) the image show perfectly in the Timage

but if the image is like (320KB, 970x800) the image show nothing in the Timage, and dont guive any error just dont show the image.



I use this routine to load the image from my DataSnap Server



var

  BlobStream: TStream;

begin

 TClienDataSet1.Open;

  BlobStream := TClienDataSet1.CreateBlobStream(TClienDataSet1.FieldByName('image'),TBlobStreamMode.bmRead);

   try

  TImage1.Bitmap.LoadFromStream(BlobStream  );

 

               finally

                  BlobStream.Free;

                end;

end;

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 22-Apr-2014, at 8:23 AM EST
From: =?Utf-8?Q?Dison_Pe=C3=B1a?=
 
Re: Loading Image from DataSnap Server to Android App  
News Group: embarcadero.public.delphi.database.multi-tier
i only know these [url=http://www.rasteredge.com/how-to/csharp-imaging/download-from-url/]image loading codes[/url], hope it is help to you. it can [url=http://www.rasteredge.com/how-to/csharp-imaging/load-from-file/]load image from file[/url], url and .net graphics. 
private void button1_Click(object sender, EventArgs e)
        {
            string fileName = "c:/Sample.png";

            REImage reImage = REFile.OpenImageFile(fileName);

            REFile.SaveImageFile(reImage, "c:/reimage.png", new PNGEncoder());

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 5-Jun-2014, at 5:36 AM EST
From: ae image
 
Re: Loading Image from DataSnap Server to Android App  
News Group: embarcadero.public.delphi.database.multi-tier
I'm not 100% sure but I recall coming across this problem in one of the other forums. I think that over a certain size blob you need to know how many bytes to read into your stream. Maybe this could be stored in another field in the database?

HTH

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 30-Jun-2014, at 5:57 PM EST
From: Stephen Corbett