Autor Beitrag
JRegier
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: Sa 23.04.05 05:54 
Ich erzeuge Images zur Laufzeit und will dann die Eigenschaften eines anderen Image
kopieren. Ich habe das mit:

ausblenden Delphi-Quelltext
1:
2:
3:
NewImage.Picture.Assign(OldImage.Picture);
oder
NewImage.Picture.Bitmap.Assign(OldImage.Picture.Bitmap);


versucht. Die neue Image wird auch angezeigt. Dann wollte ich, wenn man auf die Erzeugten
Images Clickt ein Rahmen so eine Art Focus machen.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure NewImageClick(Sender : TObject);
begin
   TImage(Sender).Canvas.DrawFocusRect(Rect(0,0,TImage(Sender).Width,TImage(Sender).Height));
end;


Dann meldet er mir Image muß ein Bitmap haben um es zu verändern. Was mache ich falsch?

Moderiert von user profile iconraziel: Delphi-Tags hinzugefügt.
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Sa 23.04.05 05:57 
ausblenden Delphi-Quelltext
1:
TImage(Sender).Canvas.DrawFocusRect(Rect(0,0,TImage(Sender).Width,TImage(Sender).Height));					


Woher soll er denn wissen welches TImage. ich würd mal Statt 'TImage' 'NewImage' schreiben.

Moderiert von user profile iconraziel: Delphi-Tags hinzugefügt.
JRegier Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: Sa 23.04.05 06:16 
user profile iconFabian W. hat folgendes geschrieben:


ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure NewImageClick(Sender :TObject);
begin  
 TImage(Sender).Canvas.DrawFocusRect(Rect(0,0,TImage(Sender).Width,TImage(Sender).Height));
end;


Woher soll er denn wissen welches TImage. ich würd mal Statt 'TImage' 'NewImage' schreiben.


Aber ich erzeuge ja mehrere Images und weise denen NewImage.OnClick := NewImageClick; zu;

Moderiert von user profile iconraziel: Code- durch Delphi-Tags ersetzt.
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Sa 23.04.05 08:09 
Was steht in 'Sender'?
JRegier Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: Mo 25.04.05 20:44 
user profile iconFabian W. hat folgendes geschrieben:
Was steht in 'Sender'?


Oh, schon Gut! Danke vielmals. Das Problem lag wohl darin das kein Bitmap vorlag uf den
ich Zeichnen wollte, weil ich vom JPG Format Assign gemacht habe. Also das muß
so heißen:

ausblenden Quelltext
1:
NewImage.Picture.Bitmap.Assign(OldImage.Picture.Graphic);					


dann wird das OldImage mit JPG Bild in Bitmap umgewandelt. Dann funzt es.