![]() |
|
|
#1
|
||||
|
||||
|
Скажите, пожалуйста, как поменять форму форме? Т.е. сделать её не в форме прямоугольника, а в форме круга, например.
|
|
#2
|
|||
|
|||
|
Один из примеров.
На форму можно положить TShape в виде круга. Делаем TransparentColor=true и совпадающие цвета Form.Color= Form.TransparentColor. Остальные настройки: Код:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls;
type
TForm1 = class(TForm)
Shape1: TShape;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
end.Код:
object Form1: TForm1
Left = 227
Top = 103
BorderStyle = bsNone
Caption = 'Form1'
ClientHeight = 340
ClientWidth = 376
Color = clBlack
TransparentColor = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object Shape1: TShape
Left = 0
Top = 0
Width = 376
Height = 340
Align = alClient // это не обязательно.
Brush.Color = clAqua
Shape = stCircle
end
endПоследний раз редактировалось AlexSku, 05.05.2011 в 10:07. |
|
#3
|
||||
|
||||
|
нужно почитать про Regions
Region Functions CombineRgn CreateEllipticRgn CreateEllipticRgnIndirect CreatePolygonRgn CreatePolyPolygonRgn CreateRectRgn CreateRectRgnIndirect CreateRoundRectRgn EqualRgn ExtCreateRegion FillRgn FrameRgn GetPolyFillMode GetRegionData GetRgnBox InvertRgn OffsetRgn PaintRgn PtInRegion RectInRegion SetPolyFillMode GetWindowRgn SetWindowRgn |
|
#4
|
||||
|
||||
|
|
|
#5
|
||||
|
||||
|
Огромное спасибо за предоставленный материал.
|