Hi...
Erstamls bedanke ich mich für deine Antwort!!
Ich habe das mal probiert, leider erstellt er bei mir immer nur ein 0kb grosses Bild, auf dem nichts zu sehen ist
Mein Code sieht folgendermassen aus:
Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19:
| procedure TForm1.Button1Click(Sender: TObject); var bmp1, bmp2: TBitmap;
begin bmp1 := TBitmap.Create; bmp2 := TBitmap.Create; try if OpenDialog1.Execute then begin bmp1.LoadFromFile(OpenDialog1.FileName); SetStretchBltMode(bmp2.Canvas.Handle, Halftone); StretchBlt(bmp2.Canvas.Handle, 0, 0, 50, 50, bmp1.Canvas.Handle, 0, 0, bmp1.Width, bmp1.Height, SRCCOPY); bmp2.SaveToFile('Dominic.bmp'); end; finally FreeAndNil(bmp1); FreeAndNil(bmp2); end; end; |
Ich habe in diesem Beispiel ein TBitmap genommen, könnte das evtl. der Fehler sein, muss ich evtl. eine andere Klasse nehmen??
Grüsse dominic