Thema: Delphi TBitmap verkleinern

Einzelnen Beitrag anzeigen

Blackheart

Registriert seit: 4. Mai 2005
846 Beiträge
 
Delphi 7 Enterprise
 
#4

Re: TBitmap verkleinern

  Alt 14. Nov 2007, 17:33
Danke für die Antworten, das hatte Ich schon probiert aber dann setz er Mir das 100x100 Bild in die Linke Ecke des großen (600x600).

Delphi-Quellcode:
procedure TForm1.Button2Click(Sender: TObject);
var
 bmpGross, bmpKlein:TBitmap;
begin
  bmpGross:=TBitmap.Create;
  bmpKlein:=TBitmap.Create;
  bmpKlein.LoadFromFile(ExtractFilePath(ParamStr(0)) + 'Bildklein.bmp');
  bmpGross.Width:=600;
  bmpGross.Height:=600;
  bmpGross.Canvas.Brush.Color:=clYellow;
  bmpGross.Canvas.FillRect(Rect(0,0,600,600));
  bmpGross.Canvas.Draw(bmpGross.Width div 2 - bmpKlein.Width div 2, bmpGross.Height div 2 - bmpKlein.height div 2, bmpKlein);
  bmpGross.Canvas.StretchDraw(Rect(0,0,100,100), bmpGross);
  bmpGross.SaveToFile(ExtractFilePath(ParamStr(0)) + 'BildNeu.bmp');
  bmpGross.Free;
  bmpKlein.Free;
end;
Irgenwo muss der Fehler stecken nur leider seh Ich ihn nicht.
Blackheart
  Mit Zitat antworten Zitat