AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Netzwerke winnet custom download thread
Thema durchsuchen
Ansicht
Themen-Optionen

winnet custom download thread

Ein Thema von drama22 · begonnen am 6. Jun 2015 · letzter Beitrag vom 6. Jun 2015
Antwort Antwort
drama22

Registriert seit: 12. Jan 2013
88 Beiträge
 
#1

winnet custom download thread

  Alt 6. Jun 2015, 19:35
hello , i succsesfly create thread to downoad images with my winnet but i have problem with adding image here is my code

Delphi-Quellcode:
//this how i try to grab file url
begin
filename := 'http://forums.accuweather.com/uploads/post-13204-1336091269.gif';
Add_Item(ListView1, FileName);
end;
and this my adding item

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:
procedure TURLDownload.Execute;
begin
FreeOnTerminate := True;
  if DownloadToStream
    then UpdateVisual;
end;

procedure TURLDownload.UpdateVisual;
begin
  FMS.Position := 0;
  if ExtractFileExt(Furl) = '.gifthen // if image is gif
begin
  aGIF := TGifImage.Create;
  aGIF.LoadFromStream(FMS);
  aGIF.Transparent := True;
  //FImage.Picture.Bitmap.LoadFromStream(FMS);
end;
end;
and this is my thread

Delphi-Quellcode:
  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;
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
  Mit Zitat antworten Zitat
Benutzerbild von Sir Rufo
Sir Rufo

Registriert seit: 5. Jan 2005
Ort: Stadthagen
9.454 Beiträge
 
Delphi 10 Seattle Enterprise
 
#2

AW: winnet custom download thread

  Alt 6. Jun 2015, 23:21
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 http://www.delphipraxis.net/185335-b...ab-xe2%5D.html
Kaum macht man's richtig - schon funktioniert's
Zertifikat: Sir Rufo (Fingerprint: ‎ea 0a 4c 14 0d b6 3a a4 c1 c5 b9 dc 90 9d f0 e9 de 13 da 60)
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 06:07 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz