![]() |
Fillrect hat falschen Hintergrund
Hallo,
ich möchte in eine Bitmap ein schraffiertes Rechteck zeichnen:
Delphi-Quellcode:
Das funktioniert zwar, aber der Hintergrund der Schraffur ist schwarz anstelle wie gewünscht weiß!PaintBitmap.Canvas.Brush.Color := clAqua; PaintBitmap.Canvas.Brush.Style := bsDiagCross; PaintBitmap.Canvas.Pen.Color := clAqua; PaintBitmap.Canvas.FillRect(rect(10, 10, 100, 100)); Was habe ich übersehen? Ciao Stefan |
AW: Fillrect hat falschen Hintergrund
Liste der Anhänge anzeigen (Anzahl: 1)
Delphi-Quellcode:
uses System.UITypes;
{$R *.dfm} type TCanvasHelper = class helper for Vcl.Graphics.TCanvas procedure setBrushBackgroundColor(const color: TColor); end; procedure TForm2.PaintBoxPaint(Sender: TObject); var c: TCanvas; begin c := (Sender as TPaintBox).Canvas; c.Brush.Style := TBrushStyle.bsDiagCross; c.Brush.Color := TColors.Aqua; c.setBrushBackgroundColor(TColors.Red); c.FillRect( TRect.Create(10, 10, 100, 100) ); end; procedure TCanvasHelper.setBrushBackgroundColor(const color: TColor); begin Win32Check( SetBkColor(Handle, color) <> 0 ); end; |
AW: Fillrect hat falschen Hintergrund
Vielleicht weil dein Bitmap schwarz ist? Vorher einfach mit FillRect den Bereich weiß füllen.
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 05:21 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