Autor Beitrag
Insignificant
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 81



BeitragVerfasst: Mi 12.07.06 20:44 
Hi, irgendwie bin ich zu doof für diese Welt.
Was ich möchte?
Ein TBitmap zur laufzeit erstellen, dieses mit Canvas und einer Farbe voll malen und es auf meine Form legen/strechen.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
procedure TForm1.FormCreate(Sender: TObject);
var
bg : TBitmap;
 rec : Trect;
begin
        rec.Left   := 0;
        rec.Top    := 0;
        rec.Right  := 148;
        rec.Bottom := 115;
 bg := TBitmap.Create;
 bg.Width := 500;
 bg.Height := 500;
    bg.Canvas.Brush.Color := clBlue;
    bg.canvas.fillrect(bg.Canvas.ClipRect);
 //  bg.Canvas.Brush.Style := bsSolid;
   // bg.canvas.rectangle(0,0,400,200);

    //bg.TransparentColor := clFuchsia;
   // bg.Transparent := true;
//    Canvas.StretchDraw(Canvas.ClipRect, bg);
   //     bg.Canvas.FillRect(rec);
 //   Canvas.StretchDraw(rec, bg) ;

end;


Hier sieht man so ungefähr alle meine Ansätze und was ich versucht habe. Alles vergebens. Ich hoffe mir kann hier jemand helfen.
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: Mi 12.07.06 20:48 
bg.Parent:=self;

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Insignificant Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 81



BeitragVerfasst: Mi 12.07.06 20:49 
Ich kann keinen Parent setzen!
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: Mi 12.07.06 20:58 
Du erzeugst statt TBitmap ein TImage und zeichnest dann im Image1.Bitmap. Dann kannst du auch Image1.Parent:=self benutzen.

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Chryzler
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1097
Erhaltene Danke: 2



BeitragVerfasst: Mi 12.07.06 21:05 
Kann man da nicht auch ein TBitmap erzeugen, wie user profile iconInsignificant es gemacht hat, und dann per Form1.Canvas.Draw(50, 50, bg) auf die Form zeichnen?
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: Mi 12.07.06 21:08 
Das wäre auch eine Möglichkeit ;)

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Insignificant Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 81



BeitragVerfasst: Mi 12.07.06 21:15 
Mein fehler war es im OnCreate zu erstellen. Aber dankeschön nochmal :) ^^