Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi DelphiX und TPictureCollectionItem (https://www.delphipraxis.net/112422-delphix-und-tpicturecollectionitem.html)

matze.glatze 21. Apr 2008 08:24


DelphiX und TPictureCollectionItem
 
Wie kann man in ein TPictureCollectionItem ein Bild direkt von der Platte laden?
Meine Ursprüngliche Lösung lädt das Logo aus einer TDXImageList. Um flexibel zu sein, wollte ich meinen Kunden die Möglichkeit geben ein eigenes Logoo einzubinden. Leider ignoriert DelphiX die Zuweisung des neuen Logos, so dass das Standardlogo immer noch sichtbar ist.

Code:
  TLogo = class(TImageSpriteEx)
  private
  protected
  public
    constructor Create(AParent: TSprite); override;
  end;

Code:
constructor TLogo.Create(AParent: TSprite);
begin
  inherited Create(AParent);
  Z := 4;
  //Standardlogo immer laden
  Image := MainForm.ImageList.Items.Find('standardlogo');

  //wenn userlogo vorhanden ist dann das laden
  if FileExists(ExtractFilePath(Application.ExeName)+'userlogo.bmp') then
  begin
   Image.Picture.Bitmap.LoadFromFile(ExtractFilePath(Application.ExeName)+'userlogo.bmp');
   Image.Picture.Bitmap.Dormant;
  end;

  Width := Image.Width;
  Height := Image.Height;
  Alpha := 128;
  X := (Mainform.DXDraw1.Display.Width-Width-10);
  Y := (Mainform.DXDraw1.Display.Height-Height-10);

  AnimCount := Image.PatternCount;
  AnimLooped := False;
end;
Weiss jemand Rat? Der Knackpunkt sollte im Find liegen - dieses liefert ja ein PictureCollectionItem zurück - allerdings waren meine Versuche einem lokal angelegtem PictureCollectionItem ein Bild zuzuweisen ebenfalls erfolglos.


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