在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
它们都是继承自 TShape 类, 共同拥有如下属性: Fill : TBrush; //填充 Stroke : TBrush; //边线(画笔) StrokeThickness : Single; //厚度(边线宽度) StrokeCap : TStrokeCap; //线帽样式, TStrokeCap (枚举)类型 StrokeDash : TStrokeDash; //虚线样式, TStrokeDash(枚举)类型 StrokeJoin : TStrokeJoin; //拐点结合样式, TStrokeJoin(枚举)类型 ShapeRect : TRectF; //可填充范围的矩形(相对于当前图形)
procedure TForm1.Button1Click(Sender: TObject); begin Line1.LineType := TLineType.ltDiagonal; //斜线 Line2.LineType := TLineType.ltTop; //横线 Line3.LineType := TLineType.ltLeft; //竖线 end;
procedure TForm1.Button1Click(Sender: TObject); begin Ellipse1.StrokeDash := TStrokeDash.sdDot; //虚线样式 Circle1.Fill.Kind := TBrushKind.bkNone; //取消填充 end;
procedure TForm1.Button1Click(Sender: TObject); begin Rectangle1.Position.X := 50; Rectangle1.Position.Y := 10; Rectangle1.Width := 100; Rectangle1.Height := 120; Rectangle1.StrokeThickness := 16; Rectangle1.Fill.Color := $80FF0000; Rectangle1.Stroke.Color := $800000FF; Rectangle1.XRadius := 8; Rectangle1.YRadius := 8; end; procedure TForm1.Button2Click(Sender: TObject); begin Rectangle2.Position.X := 350; Rectangle2.Position.Y := 10; Rectangle2.Width := 100; Rectangle2.Height := 120; Rectangle2.StrokeThickness := 4; Rectangle2.Fill.Color := claRed; Rectangle2.Stroke.Color := claBlack; Rectangle2.CornerType := TCornerType.ctBevel; Rectangle2.Corners := [TCorner.crBottomLeft, TCorner.crBottomRight]; Rectangle2.Sides := [TSide.sdBottom, TSide.sdRight]; //关于 Corners 和 Sides 还有两个非常方便的常量: AllCorners、AllSides end;
procedure TForm1.Button1Click(Sender: TObject); begin CalloutRectangle1.Width := 200; CalloutRectangle1.Height := 150; CalloutRectangle1.CalloutPosition := TCalloutPosition.cpBottom; CalloutRectangle1.CalloutWidth := CalloutRectangle1.Width / 4; CalloutRectangle1.CalloutLength := CalloutRectangle1.Height / 2; CalloutRectangle1.CalloutOffset := -CalloutRectangle1.Width / 2; end;
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论