![]() |
Text auf Bitmap (ohne weißes Feld! -> transparent?)
Hallo
ich will auf eine Bitmap einen Text schreiben:
Delphi-Quellcode:
Jetzt hab ich aber das Problem, das erst ein weißes
Image1.Canvas.Font.Color:=clRed;
Image1.Canvas.Font.Size:=20; Image1.Canvas.TextOut(20,20,'meintext'); Feld mit der größe des Textes gezeichnet wird, und dort wird der Text hineingeschrieben. Ich möchte aber das der Text zwar auf der Bitmap drauf steht, aber ohne dem weißen Feld außen herum. Kann man das irgendwie transparent machen? MfG koarlheinz |
Re: Text auf Bitmap (ohne weißes Feld! -> transparent?)
Delphi-Quellcode:
Mfg Frank
Image1.Canvas.brush.color:=bsclear;
Image1.Canvas.TextOut(20,20,'meintext'); |
Re: Text auf Bitmap (ohne weißes Feld! -> transparent?)
Habs jetzt selbst rausbekommen, aber trotzdem danke.
Delphi-Quellcode:
Image1.Canvas.Font.Color:=clRed;
Image1.Canvas.Font.Size:=20; Image1.Canvas.brush.Style :=bsclear; Image1.Canvas.TextOut(20,20,'meintext'); MfG koarlheinz |
Re: Text auf Bitmap (ohne weißes Feld! -> transparent?)
Ich löse dieses Problem mit einem weiteren Bitmap. Erstelle ein neues Bitmap, stelle Höhe und Breite ein, schreibe den Text hinein, stelle Transparent auf True, Zeichne das Bitmap mit Draw auf das alte und gebe das Hilfsbitmap mit Free frei. Kannst das alles ja einfach in eine Procedure packen.
|
Re: Text auf Bitmap (ohne weißes Feld! -> transparent?)
Moin!
Zitat:
MfG Muetze1 |
Re: Text auf Bitmap (ohne weißes Feld! -> transparent?)
Ja. Ist mir auch klar.
Aber gibt es eine einfachere Methode um ein Teil einer Bitmap auf eine Canvas zu kopieren, so dass das kopierte Bild dann transparent erscheint ? |
Re: Text auf Bitmap (ohne weißes Feld! -> transparent?)
Moin!
Setze Transparent auf True bei der Bitmap (was dann die Farbe ganz unten links zur Transparenzfarbe erklärt) und dann male mit Draw() dieses Bitmap auf deine Zeichenfläche. MfG Muetze1 |
Re: Text auf Bitmap (ohne weißes Feld! -> transparent?)
Zitat:
Und dies scheint mit die einfachste Methode zu sein: Zitat:
|
Re: Text auf Bitmap (ohne weißes Feld! -> transparent?)
Moin!
Zitat:
Rumschnauzen kann ich genauso ... Muetze1 |
Re: Text auf Bitmap (ohne weißes Feld! -> transparent?)
Hallo.
Zitat:
|
Re: Text auf Bitmap (ohne weißes Feld! -> transparent?)
Ich wette ab 100 Beiträgen hat auch er Benehmen gelernt.
Und Mützes Methode ist gut. |
Re: Text auf Bitmap (ohne weißes Feld! -> transparent?)
Zitat:
Zitat:
Mein Problem ist: (s.o.) |
Alle Zeitangaben in WEZ +1. Es ist jetzt 21:58 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 by Thomas Breitkreuz