Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Delphi: PolyDraw zeichnet nicht.

Empfohlene Antworten

Veröffentlicht

Hallo Delphianer,

ich habe folgenden Code

leider wird in der Prozedur "TitelPaint" die DrawPoly Sequenze irgendwie nicht ausgeführt !!!

Ich will eine Polygon (weißer hintergrund) 2 Points Pen scwarz haben - wie geht das ???

danke für hilfe


unit main;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls;

type
TForm1 = class(TForm)
Panel1: TPanel;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
procedure TitelPaint(var msg: TWMNCPaint); message WM_NCPAINT;
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.TitelPaint(var msg: TWMNCPaint);
var
tr: TRect;
dc: HDC;
hb: HBRUSH;
pt: Byte;
PolyR1: array[1..5] of TPoint;
begin
hb := CreateSolidBrush(RGB(0,0,200));
dc := GetWindowDC(self.Handle);
FillRect(dc,rect(0,0,Width,25),hb);
FillRect(dc,rect(0,0,2,Height),hb);
DeleteObject(hb);

PolyR1[1].x := 17; PolyR1[1].y := 5;
PolyR1[2].x := 10; PolyR1[2].y := 5;
PolyR1[3].x := 0; PolyR1[3].y := 15;
PolyR1[4].x := 0; PolyR1[4].y := 23;
PolyR1[5].x := 17; PolyR1[5].y := 5;

hb := CreatePen(PS_SOLID,4,RGB(200,200,200));
SelectObject(dc,hb);
pt := PT_MOVETO;
PolyDraw(dc,PolyR1,pt,5);
DeleteObject(hb);

///self.Paint;
end;

procedure TForm1.FormCreate(Sender: TObject);
var
FullRgn,
ClientRgn,
ControlRgn: THandle;
X,
Y: Integer;
PolyR1: array[0..8] of TPoint;
begin
PolyR1[0].x := 17; PolyR1[0].y := 0;
PolyR1[1].x := 17; PolyR1[1].y := 5;
PolyR1[2].x := 10; PolyR1[2].y := 5;
PolyR1[3].x := 0; PolyR1[3].y := 15;
PolyR1[4].x := 0; PolyR1[4].y := 25;
PolyR1[5].x := 0; PolyR1[5].y := Height;
PolyR1[6].x := Width; PolyR1[6].y := Height;
PolyR1[7].x := Width; PolyR1[7].y := 26;
PolyR1[8].x := Width-30; PolyR1[8].y := 0;

FullRgn := CreatePolygonRgn(PolyR1,9,ALTERNATE);
SetWindowRgn(Handle, FullRgn, True);
end;

end.
[/PHP]

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.