Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Cross-Platform-Entwicklung (https://www.delphipraxis.net/91-cross-platform-entwicklung/)
-   -   Fehler Firemonkey im OnPaint? (https://www.delphipraxis.net/191984-fehler-firemonkey-im-onpaint.html)

sko1 10. Mär 2017 10:42

Fehler Firemonkey im OnPaint?
 
Hallo,

ich zeichne auf einem Panel im OnPaint:

Delphi-Quellcode:
procedure TForm1.Panel1Paint(Sender: TObject; Canvas: TCanvas;
  const ARect: TRectF);
var
  b, h: single;
begin
  b := ARect.Width;
  h := ARect.Height;
  with Canvas do
  begin
    BeginScene();
    fill.Color := talphacolors.Black;
    stroke.Color := talphacolors.Black;
    StrokeThickness := 5;
    FillText(Rectf(0, 30, 200, 50), 'Hallo Du Da', false, 1, [],
      TTextAlign.Leading, TTextAlign.Leading);
    DrawLine(Pointf(0, 20), Pointf(b, 20), 1);
    DrawLine(Pointf(0, 0), Pointf(b, h), 1);
    EndScene;
  end;
end;

Unter Windows ist der Text und die zwei dicken Striche sichtbar, auf dem Android-Handy nur der Text!
Was ist denn da schon wieder "kaputt" ?

Hat jemand eine zündende Idee?

Ciao
Stefan

sko1 10. Mär 2017 12:22

AW: Fehler Firemonkey im OnPaint?
 
StackOverFlow hat mir die Lösung verraten, wieder mal typisch Embarcadreo:

In Android ist defaultmäßig

Delphi-Quellcode:
Stroke.Kind := TBrushKind.None;


und klar, wenn man das dann im Code nicht explizit setzt, wird auch nichts gezeichnet...
Warum aber die Defaulteinstellung für Windows und Android unterschiedlich ist, kann nur Embarcadero erklären ;-)

Ciao
Stefan


Alle Zeitangaben in WEZ +1. Es ist jetzt 21:39 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