Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Multimedia (https://www.delphipraxis.net/16-multimedia/)
-   -   Delphi Bild in StatusBar (https://www.delphipraxis.net/3072-bild-statusbar.html)

Yheeky 21. Feb 2003 15:45


Bild in StatusBar
 
Hi,

wie bekomme ich ein Bild in eine StatusBar? Habe keine Möglichkeit gefunden.

Gruß Yheeky

oki 21. Feb 2003 15:54

Panel kreieren, OwnerDraw setzen, im Ereignis OnDraw Bild aus einer ImageListe auf Canvas zeichnen.

Mußte leider kurz machen, schau Montag wieder rein.

Hab doch noch schnell eigenen Code gefunden

Delphi-Quellcode:

procedure TForm1.StatusBar1DrawPanel(StatusBar: TStatusBar;
  Panel: TStatusPanel; const Rect: TRect);
var Index : Integer;
begin
  with StatusBar1.Canvas do begin
    IF Panel = Statusbar1.Panels[1] then begin
      IF FCommActiv then Index := 4 else Index := 9;
    end;
    IF Panel = Statusbar1.Panels[2] then begin
      IF FDispActiv then Index := 1 else Index := 6;
    end;
    IF Panel = Statusbar1.Panels[3] then begin
      IF FKonfActiv then Index := 2 else Index := 7;
    end;
    IF Panel = Statusbar1.Panels[4] then begin
      IF FServActiv or FServIPActive then Index := 0 else Index := 5;
    end;
    ImageList1.Draw(StatusBar1.Canvas,Rect.Left,Rect.Top, Index);
  end;
end;
Den Schmuß mit if usw. ist eigener kram und muß Dich nicht kümmern. Der entscheidende Teil ist
Delphi-Quellcode:
ImageList1.Draw(StatusBar1.Canvas,Rect.Left,Rect.Top, Index);
gruß oki

CalganX 21. Feb 2003 15:57

Neue Komponente entwickeln.
Ich habe mal eine gemacht. Allerdings ist hier eine andere Möglichkeit, da ich derzeit nich von zu Hause aus schreibe:
Delphi-Quellcode:
procedure TForm1.FormCreate(Sender: TObject);
begin
  ProgressBar1.Parent := StatusBar1;
  ProgressBar1.Left := {wie weit von links in der Statusbar entfernt};
  ProgressBar1.Top := 1;
end;
Chris

Yheeky 21. Feb 2003 16:16

Danke, hat geklappt!

Gruß Yheeky


Alle Zeitangaben in WEZ +1. Es ist jetzt 09:48 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