Autor Beitrag
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Fr 26.01.07 19:57 
Habe eine Variable vom Typ TBitmap. Wie sorge ich dafür, dass der Inhalt in Image1 angezeigt wird? :gruebel:

_________________
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
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Fr 26.01.07 20:00 
ausblenden 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. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Fr 26.01.07 20:03 
ausblenden 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
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 275

WinXP
BDS 2006
BeitragVerfasst: 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. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Fr 26.01.07 20:13 
user profile iconRobinator hat folgendes geschrieben:
Du musst dem Image.Bitmap erst .width und .height geben, dann sollte es so funktionieren ;)

gruss, rob

Jop er machts!!! :zustimm:
Thx! ;)

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot