![]() |
Problem mit Stretchblt
Hi,
warum funktioniert Stretchblt nicht wenn ich als Ziel image1.picture.bitmap angebe? Nutze ich statt image1 den canvas einer Form funktioniert das einwandfrei. ( t ist als tbitmap deklariert und create ist aufgerufen).
Delphi-Quellcode:
Vielen Dank im Vorraus!
image1.picture.bitmap.Width:=500;image1.picture.bitmap.Height:=500;
stretchblt(image1.picture.bitmap.handle, 200,200,image1.picture.bitmap.width,image1.picture.bitmap.height, t.canvas.handle, 100,100,t.width,t.height, SRCCOPY); |
Re: Problem mit Stretchblt
Hi,
so funktioniert das Ganze. Ist mit aber nicht klar warum.
Delphi-Quellcode:
Der einzige Unterschied besteht darin dass ich einmal das handle der Bitmap als Ziel angebe und das andere Mal den Canvas von Image.
image1.picture.bitmap.Width:=500;image1.picture.bitmap.Height:=500;
stretchblt(image1.canvas.handle, 0,0,sb1.position,sb1.position,//image1.picture.bitmap.width,image1.picture.bitmap.height, t.canvas.handle, 100,100,t.width,t.height, SRCCOPY); Kann mir jemand auf die Sprünge helfen? Vielen Dank im Vorraus! |
Re: Problem mit Stretchblt
Zitat:
|
Re: Problem mit Stretchblt
Sowohl ein Bitmap als auch ein Canvas haben ein Handle, für Stretchblt kannst du aber nur das Handle von einem Canvas benutzen! Bitmpa.Handle <> Bitmap.Canvas.Handle
Auch wenn beide in Delphi den gleichen Typ haben und zuweisungskompatibel sind, ist das eine ein HDC und das andere ein HBITMAP ;) |
Re: Problem mit Stretchblt
Hi,
ich bin ja soo doof! Hätte ich auch selbst drauf kommen können! Danke! |
Alle Zeitangaben in WEZ +1. Es ist jetzt 09:54 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