Thema: Delphi [DelphiX] Phantom Sprite

Einzelnen Beitrag anzeigen

Benutzerbild von Neutral General
Neutral General

Registriert seit: 16. Jan 2004
Ort: Bendorf
5.219 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#8

Re: [DelphiX] Phantom Sprite

  Alt 25. Aug 2006, 15:35
Dank mimi bekomme ich jetzt Schrift zu sehen und es bewegt sich nichts mehr
Thx nochmal

Also das ganze sieht jetzt vorerst mal so aus (bis alles klappt):

Delphi-Quellcode:
procedure TSpriteButton.SetCaption(const Value: String);
begin
  FCaption := Value;
 
  FSprite.Image.Picture.Bitmap.Canvas.Brush.Style := bsClear;
  FSprite.Image.Picture.Bitmap.Canvas.Font.Color := clred;
  FSprite.Image.Picture.Bitmap.Canvas.TextOut(0,0,Value);
  FSprite.Image.Restore;
end;
Das Problem ist das das zweite mal die erste Schrift nicht überschrieben wird.. Naja hab ich gedacht dann speicher ich den Index des Sprite-Bildes auch ab und mache es so:

Delphi-Quellcode:
procedure TSpriteButton.SetCaption(const Value: String);
begin
  FCaption := Value;
  
  FSprite.Image := FSprite.Image.PictureCollection.Items[PicIndex];
  FSprite.Image.Picture.Bitmap.Canvas.Brush.Style := bsClear;
  FSprite.Image.Picture.Bitmap.Canvas.Font.Color := clred;
  FSprite.Image.Picture.Bitmap.Canvas.TextOut(0,0,Value);
  FSprite.Image.Restore;
end;
Lade mir immer ein frisches Bild aus der Liste und male dadrauf.
Aber nix da o.O Wenn ich mit FSprite.Image...Canvas auf das Bild male wird das Bild der Imagelist auch verändert o.O
Was mach ich denn da am besten?

Gruß
Neutral General
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."
  Mit Zitat antworten Zitat