Autor Beitrag
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Fr 04.03.05 21:45 
Moin :)!

Ich kopiere mit folgendem Code BitBlt(Bitmap.Canvas.Handle, 0, 0, Bitmap.Width, Bitmap.Height, PaintBox1.Canvas.Handle, 0, 0, SRCCOPY); eine Grafik in ein TBitmap-Objekt. Allerdings habe ich Probleme mit dem letzten Parameter: welche Werte sind zulässig bzw. was bewirken sie? Die Delphi-OH hüllt sich in Schweigen - in meiner D7PE findet die Suche BitBlt nichtmal...
Wenn ich den letzten Parameter auf 0 lasse wird das Bild schwarz - ergo nicht der richtige Wert. Welchen Wert muss ich jetzt verwenden?

Thx :)
AXMD


Zuletzt bearbeitet von AXMD am Fr 04.03.05 21:58, insgesamt 1-mal bearbeitet
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Fr 04.03.05 21:50 
Logisch, ist ja auch eine WinAPI Funktion und die hat in der Delphi Hilfe nichts verloren: Suche im MSDN BITBLT, da steht alles.
AXMD Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Fr 04.03.05 21:52 
:autsch: Danke dir :autsch:

AXMD
AXMD Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Fr 04.03.05 21:58 
Eine Frage noch (hab 0 durch SRCCOPY ersetzt im oberen Code): warum erhalte ich ein Bild, das so aussieht?

user defined image

AXMD
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: Fr 04.03.05 22:44 
AXMD hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
BitBlt(Bitmap.Canvas.Handle, 0, 0, Bitmap.Width, Bitmap.Height, PaintBox1.Canvas.Handle, 0, 0, SRCCOPY);					
Wann erhältst du ein solches Bild? Nachdem du andere Fenster über der Paintbox hattest? Das liegt daran, daß die Paintbox sich im Gegensatz zum Image nicht von alleine neu zeichnet, dazu musst du einen Event-Handler für das OnPaint-Event einrichten, der das Bild neu zeichnet.

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert
AXMD Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Fr 04.03.05 22:45 
tommie-lie hat folgendes geschrieben:
AXMD hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
BitBlt(Bitmap.Canvas.Handle, 0, 0, Bitmap.Width, Bitmap.Height, PaintBox1.Canvas.Handle, 0, 0, SRCCOPY);					
Wann erhältst du ein solches Bild? Nachdem du andere Fenster über der Paintbox hattest? Das liegt daran, daß die Paintbox sich im Gegensatz zum Image nicht von alleine neu zeichnet, dazu musst du einen Event-Handler für das OnPaint-Event einrichten, der das Bild neu zeichnet.


Ein solcher Eventhandler existiert bereits... Außerdem wird viel zu viel kopiert wie du im oberen Bild siehst ;)

AXMD
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: Fr 04.03.05 22:53 
AXMD hat folgendes geschrieben:
Außerdem wird viel zu viel kopiert wie du im oberen Bild siehst ;)
Kleiner Denkfehler, hab' die Parameter verwechselt ;-)
Komisch eigentlich, daß im DC der Paintbox Informationen drin sind, die eigentlich nicht reingehören :gruebel:

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert
AXMD Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Fr 04.03.05 23:34 
Das wohl... mit DoubleBuffered oder der Tatsache, dass das Ganze auf einem Panel liegt hat das aber nichts zu tun, oder?

AXMD