Thema: Delphi Spielherstellung

Einzelnen Beitrag anzeigen

Benutzerbild von SirThornberry
SirThornberry
(Moderator)

Registriert seit: 23. Sep 2003
Ort: Bockwen
12.235 Beiträge
 
Delphi 2006 Professional
 
#3

Re: Spielherstellung

  Alt 6. Sep 2006, 06:38
das einfachste wäre wohl von TCustomControl abzuleiten und im SetBounds mit CreatePolygonRgn die sechseckige Form setzen
Je nach Muster zum Beispiel so
Delphi-Quellcode:
procedure TMyComp.SetBounds(ALeft, ATop, AWidth, AHeight: Integer);
var
  HR : Cardinal;
  lPoints: Array[0..5] of TPoint;
  lWidth: Integer;
begin
  lWidth := AWidth div 4;
  lPoints[0] := Point(lWidth, 0);
  lPoints[1] := Point(AWidth - lWidth, 0);
  lPoints[2] := Point(AWidth - 1, AHeight div 2);
  lPoints[3] := Point(AWidth - lWidth, AHeight - 1);
  lPoints[4] := Point(lWidth, AHeight - 1);
  lPoints[5] := Point(0, AHeight div 2);
  HR:= CreatePolygonRgn(lPoints, 6, ALTERNATE);
  SetWindowRgn(Handle, HR, True);

  DeleteObject(HR);
  inherited;
end;
Jens
Mit Source ist es wie mit Kunst - Hauptsache der Künstler versteht's
  Mit Zitat antworten Zitat