| Autor |
Beitrag |
Marco D.
      
Beiträge: 2750
Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
|
Verfasst: Fr 26.01.07 19:57
Habe eine Variable vom Typ TBitmap. Wie sorge ich dafür, dass der Inhalt in Image1 angezeigt wird? 
_________________ Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
|
|
jakobwenzel
      
Beiträge: 1889
Erhaltene Danke: 1
XP home, ubuntu
BDS 2006 Prof
|
Verfasst: Fr 26.01.07 20:00
Delphi-Quelltext 1:
| Image1.Picture.Assign(DeinBitmap) |
oder
Image1.Picture.Bitmap.Canvas.Draw(x,y,DeinBitmap (dann muss aber schon was angezeigtz werden)
_________________ I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
|
|
Marco D. 
      
Beiträge: 2750
Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
|
Verfasst: Fr 26.01.07 20:03
Delphi-Quelltext 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12:
| procedure TForm1.Button4Click(Sender: TObject); var bt: TBitmap; begin bt := TBitmap.Create; with bt.Canvas do begin Pen.Color := clblack; Brush.Color := clwhite; Rectangle(0,0,10+TextWidth('UserManager')+10,5+TextHeight('UserManager')+5); end; Image1.Picture.Bitmap.Canvas.Draw(0,0,bt); end; |
Es wird aber nichts angezeigt.
Wenn ich direkt auf Image1.Canvas zeichne, dann sehe ich was, also sind die Zeichnen-Anweisungen korrekt.
_________________ Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
|
|
Robinator
      
Beiträge: 275
WinXP
BDS 2006
|
Verfasst: Fr 26.01.07 20:07
Du musst dem Image.Bitmap erst .width und .height geben, dann sollte es so funktionieren
gruss, rob
|
|
Marco D. 
      
Beiträge: 2750
Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
|
Verfasst: Fr 26.01.07 20:13
_________________ Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
|
|
|