![]() |
Copyrect geht nicht
Hi,
warum geht das nicht? Img2 bleibt leer:
Delphi-Quellcode:
Ich will einen Teil von img in img2 kopieren.
img := TBitmap.create;
img.loadfromfile('c:\xmas.bmp'); img2 := TBitmap.create; myrect := rect(0, 0, 80, 80); myrect2 := rect(0, 0, 80, 80); img2.canvas.copyrect(myrect, img.Canvas, myrect2); mybutton.Glyph := img2; img.Free; MFG Chris. |
Re: Copyrect geht nicht
Moin!
Ganz einfach, weil img2 keine Höhe und Weite hat - und daher 0x0 Pixel gross ist. Du musst die Grösse des Bitmaps vorher festlegen, CopyRect() oder andere Funktionen kümmern sich nicht darum...
Delphi-Quellcode:
MfG
img := TBitmap.create;
img.loadfromfile('c:\xmas.bmp'); img2 := TBitmap.create; img2.Width := 81; img2.Height := 81; myrect := rect(0, 0, 80, 80); myrect2 := rect(0, 0, 80, 80); img2.canvas.copyrect(myrect, img.Canvas, myrect2); mybutton.Glyph := img2; img.Free; Muetze1 |
Alle Zeitangaben in WEZ +1. Es ist jetzt 12:16 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz