AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

GIF in TImage

Ein Thema von qb-tim · begonnen am 10. Mai 2006 · letzter Beitrag vom 11. Mai 2006
Antwort Antwort
Benutzerbild von qb-tim
qb-tim

Registriert seit: 3. Mär 2006
Ort: Deutschland
280 Beiträge
 
Delphi 6 Professional
 
#1

Re: GIF in TImage

  Alt 11. Mai 2006, 14:51
Hhmm...

Delphi-Quellcode:
//in Unit1 - Form1 ist schon erstelt worden
var
  Form1: TForm1;
  Test: TGIFImage;

implementation

{$R *.dfm}

procedure TForm1.FormActivate(Sender: TObject);
begin
 Form1.Height := 231;
 Form1.Width := 165;
 Test := TGifImage.Create;
 Test.Height := 231;
 Test.Width := 165;
 Test.LoadFromFile('C:\gif\pic001.gif');
 Test.Paint(Canvas,Form1.ClientRect,[goDirectDraw]);
end;
Dann kommt die Fehlermeldung: "Im Projeck Project1.exe ist eine Exception der Klasse EOSError aufgetreten. Meldung: 'Systemfehler. Code: 6. The handle is invalid'. Prozeß wurde angehalten. Mit Einzelne Anweisung oder Start fortsetzen." und der folgende Text wird blau markiert:

Delphi-Quellcode:
// Line: 12440
Result := nil;
Dieser Befehl befand sich in der GifUnit:

Delphi-Quellcode:
// Internal pain(t) routine used by Draw()
function TGIFImage.InternalPaint(Painter: PGifPainter; ACanvas: TCanvas;
  const Rect: TRect; Options: TGIFDrawOptions): TGIFPainter;
begin
  if (Empty) or (Rect.Left >= Rect.Right) or (Rect.Top >= Rect.Bottom) then
  begin
    Result := nil;
    if (Painter <> nil) then
      Painter^ := Result;
    exit;
  end;

  // Draw in main thread if only one image
  if (Images.Count = 1) then
    Options := Options - [goAsync, goAnimate];

  Result := TGIFPainter.CreateRef(Painter, self, ACanvas, Rect, Options);
  FPainters.Add(Result);
  Result.OnStartPaint := FOnStartPaint;
  Result.OnPaint := FOnPaint;
  Result.OnAfterPaint := FOnAfterPaint;
  Result.OnLoop := FOnLoop;
  Result.OnEndPaint := FOnEndPaint;

  if not(goAsync in Options) then
  begin
    // Run in main thread
    Result.Execute;
    // Note: Painter threads executing in the main thread are freed upon exit
    // from the Execute method, so no need to do it here.
{hier kommt der Fehler!}
    Result := nil;
    if (Painter <> nil) then
      Painter^ := Result;
  end else
    Result.Priority := FThreadPriority;
end;
Was habe ich (oder ist) falsch?

PS: Ich habe die GifUnit von hier: http://www.torry.net/vcl/graphics/gif/gifimaged7c.zip
  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 00:32 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 by Thomas Breitkreuz