![]() |
winnet custom download thread
hello , i succsesfly create thread to downoad images with my winnet but i have problem with adding image here is my code
Delphi-Quellcode:
and this my adding item
//this how i try to grab file url
begin filename := 'http://forums.accuweather.com/uploads/post-13204-1336091269.gif'; Add_Item(ListView1, FileName); end;
Delphi-Quellcode:
Procedure Tform.Add_Item(ListView : TListView; strFile: String);
begin With TURLDownload.Create( Image1 ) do begin Memo1.Lines.Add(' Image Download Thread... @ThreadID = ' + IntToStr( ThreadID ) ); URL := strFile; Resume; end; With ListView.Items.Add do begin Caption := ''; SubItems.Add( strCaption ); // subitem 0 SubItems.AddObject( 'IMA', TObject( aGif ) ); // subitem 1 end; and this is my thread execute
Delphi-Quellcode:
and this is my thread
procedure TURLDownload.Execute;
begin FreeOnTerminate := True; if DownloadToStream then UpdateVisual; end; procedure TURLDownload.UpdateVisual; begin FMS.Position := 0; if ExtractFileExt(Furl) = '.gif' then // if image is gif begin aGIF := TGifImage.Create; aGIF.LoadFromStream(FMS); aGIF.Transparent := True; //FImage.Picture.Bitmap.LoadFromStream(FMS); end; end;
Delphi-Quellcode:
the problem is my application is multiable client application and Add_Item(ListView1, FileName); procedure requested each time my clients are entered to grab this images of other clients the problem is images not loaded until some client disconneceted or possibly i do the whole process in wrong way by the way aGIF : TGifImage; is a global variable
type
TURLDownload = class(TThread) private FImage : TImage; FMs: TMemoryStream; FURL: String; procedure UpdateVisual; function DownloadToStream: Boolean; protected procedure Execute; override; public constructor Create( aImage:TImage ); destructor Destroy; override; public property URL: String read FURL write FURL; end; |
AW: winnet custom download thread
You send someone to get you the car and right after this you try to enter the car and fall on your bottom. Why?
If you got the answer, you have the answer for your question here. Afterwards you should have a look at the ![]() |
Alle Zeitangaben in WEZ +1. Es ist jetzt 02:03 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz