29-02-2020, Saat: 23:06
(29-02-2020, Saat: 10:41)41linea41 Adlı Kullanıcıdan Alıntı: Merhaba
FMX uygulamada aşağıdaki kod windows üzerinde çalışıyor ama android üzerinde çalışmıyor.Aldığım hata:
Kod: (Select All)
... exception class segmentetion Fault(11)
Amaç, postgres den resimleri çekip imagelist içine atarak eğitim video 5 1:25 de anlatılanı yapmak.
uygulamayı windows da debug yaparsam sorunsuz çalışıyor. Android de F8 ile uygulamayı çalıştırırsam yukardaki hatayı alıyorum.
F9 ile debug yaparsam hatasız devam ediyor ama resimleri göstermiyor.
Aşağıdaki kod thread içinde çalışıyor ilk açılışta bir defa çalışsın ve açılışı yavaşlatmasın maksadıyla thread içine aldım.
Kod: (Select All)
procedure coklu.Execute;
var
ms:TMemoryStream;
Resim:FMX.Graphics.TBitmap;
begin
franaframe.imgGun.PictureList.Clear(true,true);
ms:=TMemoryStream.Create;
resim:= TBitmap.Create();
inherited;
try
try
datam.uniPostgre.Connected:=True;
with datam.qrGunler do
begin
Close;
Open;
First;
while not (Eof) do
begin
TBlobfield(datam.qrgunlerRESIM).SaveToStream(ms);
ms.Position:=0;
Resim.LoadFromStream(ms);
//franaframe.imgGun.PictureList.Add.LoadFromStream(ms); //LoadPictureDownloaded('https://im0-tub-tr.yandex.net/i?id=047812d8478ce00dab013960b0b3eb17&n=13');
franaframe.imgGun.PictureList.Add.Assign(resim);
ms.Clear;
Next;
end;
end;
except on E: Exception do
ShowMessage(E.Message);
end;
finally
ms.Free;
resim.Free;
end;
end;
İyi çalışmalar dilerim.
Sorunu çözemedim. Bilgim, kapasitem yeterli olmadı. Delphican ve stackoverflowdaki örneklerden de sonuç elde edemedim.
Çözüme ulaşmak için strateji değiştirmek zorunda kaldım.
Resimleri webe yükleyip linkleri postgrese kaydettim. Aşağıdaki kod ile de çekiyorum.
Bahse konu ImageList Orange UI TskinImagelist dir. Url özelliği bulunmaktadır.
Kod: (Select All)
var
res:TDrawPicture;
try
try
datam.uniPostgre.Connected:=True;
with datam.qrGunler do
begin
Close;
Open;
First;
while not (Eof) do
begin
FRANAFRAME.imgGun.PictureList.BeginUpdate;
res:=franaframe.imgGun.PictureList.Add;
//res.LoadFromStream(ms);
res.Url:=DataM.qrgunleradres.value;
franaframe.imgGun.PictureList.endUpdate;
next;
end;
end;
except on E: Exception do
// ShowMessage(E.Message);
end;
finally
end;
