Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Multimedia (https://www.delphipraxis.net/16-multimedia/)
-   -   Delphi Bild der PaintBox (https://www.delphipraxis.net/22414-bild-der-paintbox.html)

daniel8520 17. Mai 2004 14:54


Bild der PaintBox
 
Hallo Leute,

wie, oder kann man überhaupt, das Bild einer PaintBox, also das Canavas, in einer Bilddatei speichern? BMP würde mir ja reichen.

Geht das denn?
Falls ja: kann mir jemand sagen: wie?

Jens Schumann 17. Mai 2004 14:59

Re: Bild der PaintBox
 
Hallo,
man neheme ein TBitmap und kopiere den Inhalt der TPaintBox.Canvas auf die TBitmap.Canvas und rufe TBitmap.SaveToFile auf.

Für das Kopieren empfehle ich die API-Funktion BitBlt. Vor dem koipieren das setzten von TBitmap.Width und TBitmap.Height auf TPaintBox.Width und TPaintBox.Height nicht vergessen.

daniel8520 17. Mai 2004 15:17

Re: Bild der PaintBox
 
Ähm...soweit klar, aber wo finde ich die Komponente TBitmap???

Jens Schumann 17. Mai 2004 17:51

Re: Bild der PaintBox
 
Zitat:

Zitat von daniel8520
Ähm...soweit klar, aber wo finde ich die Komponente TBitmap???

TBitmap ist keine Komponente. Bis Du schon mal auf die Idee gekommen in der OH nach TBitmap zu suchen?

XeRo 17. Mai 2004 18:09

Re: Bild der PaintBox
 
Warum verwendest du eigentlich die paintbox...ich würd gleich ein Timage nehme, da hast befehle wie SaveToFile und LoadFromFile...

oder hat die paintbox irgendwelche vorteile von denen ich nix weis?

Nicolai1234 17. Mai 2004 18:42

Re: Bild der PaintBox
 
Man kann lichter reinzeichnen!
Oder irre ich mich da?


Alle Zeitangaben in WEZ +1. Es ist jetzt 11:20 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz