Veröffentlicht 25. Mai 200322 j 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.