 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Michael Alexin Guest
|
Posted: Thu Apr 08, 2004 3:29 pm Post subject: Trying to create non-rectangular control |
|
|
Hi all!!
I'm trying to create control non-rectangular control descendant from TCustomControl. I'm use the following code for this:
procedure TDinPoint.Paint;
var
rgn1: HRGN;
br: TBrush;
begin
inherited Paint;
//Fpoints - array of TPoint
rgn1 := CreatePolygonRgn(FPoints, 3, ALTERNATE);
br := TBrush.Create;
br.Color := clWhite;
br.Style := bsSolid;
FillRgn(Canvas.Handle,rgn1,br.Handle);
SetWindowRgn(Self.Handle,rgn1,True);
end;
But if FPoints is dynamic array this trics doesn't work=(
What should i do?
Thanx 4 advance!!!
|
|
| Back to top |
|
 |
Soeren Muehlbauer Guest
|
Posted: Thu Apr 08, 2004 3:40 pm Post subject: Re: Trying to create non-rectangular control |
|
|
Hi,
| Quote: | procedure TDinPoint.Paint;
var
rgn1: HRGN;
br: TBrush;
begin
inherited Paint;
//Fpoints - array of TPoint
rgn1 := CreatePolygonRgn(FPoints, 3, ALTERNATE);
br := TBrush.Create;
br.Color := clWhite;
br.Style := bsSolid;
FillRgn(Canvas.Handle,rgn1,br.Handle);
SetWindowRgn(Self.Handle,rgn1,True);
end;
But if FPoints is dynamic array this trics doesn't work=(
What should i do?
Thanx 4 advance!!!
|
How about:
rgn1:=CreatePolygonRgn(FPoints[0],Length(FPoints), ALTERNATE);
HTH, Soeren
|
|
| Back to top |
|
 |
Nils Haeck Guest
|
Posted: Thu Apr 08, 2004 6:37 pm Post subject: Re: Trying to create non-rectangular control |
|
|
Indeed, the address FPoints[0] points to the first element. The FPoints
pointer is not pointing to the first element but another location in memory,
where object and size info is stored (at least, that's what I suspect).
Nils
"Soeren Muehlbauer" <soeren.dd (AT) gmx (DOT) de> wrote
| Quote: | Hi,
procedure TDinPoint.Paint;
var
rgn1: HRGN;
br: TBrush;
begin
inherited Paint;
//Fpoints - array of TPoint
rgn1 := CreatePolygonRgn(FPoints, 3, ALTERNATE);
br := TBrush.Create;
br.Color := clWhite;
br.Style := bsSolid;
FillRgn(Canvas.Handle,rgn1,br.Handle);
SetWindowRgn(Self.Handle,rgn1,True);
end;
But if FPoints is dynamic array this trics doesn't work=(
What should i do?
Thanx 4 advance!!!
How about:
rgn1:=CreatePolygonRgn(FPoints[0],Length(FPoints), ALTERNATE);
HTH, Soeren
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|