在这篇文章中,我们将为您详细介绍如何绘制一个圆形button,并在上面做标签的内容,并且讨论关于如何绘制一个圆形button,并在上面做标签的相关问题。此外,我们还会涉及一些关于如何绘制一个星星形状的
在这篇文章中,我们将为您详细介绍如何绘制一个圆形button,并在上面做标签的内容,并且讨论关于如何绘制一个圆形button,并在上面做标签的相关问题。此外,我们还会涉及一些关于 如何绘制一个星星形状的水波图、(15)各种Button 与排列 OutlineButton,ButtonBar,Expanded,RaisedButton,StadiumBorder,FlatButton.icon、3DMAX如何绘制一个好看的花瓶、Auto CAD2020怎么绘制一个圆与另一个圆相切-Auto CAD2020绘制一个圆与另一个圆相切教程的知识,以帮助您更全面地了解这个主题。
本文目录一览:- 如何绘制一个圆形button,并在上面做标签(如何绘制一个圆形button,并在上面做标签)
- 如何绘制一个星星形状的水波图
- (15)各种Button 与排列 OutlineButton,ButtonBar,Expanded,RaisedButton,StadiumBorder,FlatButton.icon
- 3DMAX如何绘制一个好看的花瓶
- Auto CAD2020怎么绘制一个圆与另一个圆相切-Auto CAD2020绘制一个圆与另一个圆相切教程
如何绘制一个圆形button,并在上面做标签(如何绘制一个圆形button,并在上面做标签)
我想制作一个圆形button,并在上面贴上标签,但是我不能,我试图制作椭圆形,但是我不知道如何在上面贴上标签。 我想做一些完全像这个形象
Windows 8应用程序C#
Perfmon,PerfMonitor和PerfView
为什么System.Environment.MachineName值是大写的?
Windows服务无法正常工作时,exe文件转换为服务
在C#中获取Windows Serverclosures原因
如何阅读设备和驱动程序版本
你可以尝试下面的方法:
<Grid> <Ellipse strokeThickness="2" stroke="Black" Width="150"> <Ellipse.Fill> <ImageBrush ImageSource="/Image/someImage.png"/> </Ellipse.Fill> </Ellipse> <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="The Demo Case" Margin="0,60,0" Foreground="Green"/> </Grid>
使用网格,将椭圆和TextBlock放置在网格中。
<Grid> <Ellipse ... /> <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" /> </Grid>
如何绘制一个星星形状的水波图
G2Plot 最初诞生于阿里经济体 BI 产品真实场景的业务诉求,基于 G2 图形语法,一图一做扩展常见的业务图表。
在 G2Plot 2.3.14 版本,水波图提供了 shape 的配置,允许用户自定义水波图形状,并且内置了多种图形形状,如下,
圆形 | 菱形(钻石) | 矩形 | 水滴型 |
虽然内置了若干形状,但使用者的需求是变幻无穷的。因此我们也开放了自定义 shape 的方式:只需要传入一个构建 Path 的回调函数即可,方便开发者可以按照自己的诉求来定制水波图形状,下面是一些自定义形状的水波图。
本篇文章会先简单介绍下这个自定义 shape 的 API 使用,然后再从较为简单的五角星 ☆ 出发,介绍下如何基于 G2Plot 水波图定制星星水波图。
更多详细内容可以查看 ☞ :1、水波图 图表指引,2、水波图 API 文档
shape API 简单介绍
- shape 属性接受一个回调函数,返回执行类型的 Path 绘图指令(同 SVG path 相近,详细可以查看 G | Path)
- 回调参数为中心点的 x、y,容器宽度 width 以及容器高度 height。如图 1 所示:
图 1
下面是文档中的一个示例代码,我们根据注释稍微解释一下:
function shape(x: number, y: number, width: number, height: number) {
const h = height / 2;
const w = width / 2;
return [
// 移动到画布左上角 (x - w, y - h)
[''M'', x - w, y - h],
// 连接至画布右上角 (x + w, y - h)
[''L'', x + w, y - h],
// 连接画布右下角 (x + w, y + h)
[''L'', x + w, y + h],
// 连接画布左下角 (x - w, y + h)
[''L'', x - w, y + h],
// 使用“闭合路径命令” Z 进行闭合
[''Z''],
];
}
预览效果如图 2: 图 2
绘制 Star 水波图
默认大家有一定的数学基础
首先,我们需要获取各个顶点的坐标,然后使用 moveTo (M 命令)和 lineTo(L 命令)把五角星的路径计算出来。 图 3
看图 3 分析可知:O 点对应的是 (x, y) , A 点坐标 (Math.cos(18 * Math.PI / 180) * w + x, -Math.sin(18 * Math.PI / 180) * w + y)
,再以此计算出各个顶点的坐标即可。完整代码如下:
shape: (x, y, width, height) => {
const path = [];
const w = Math.min(width, height) / 2;
for (let i = 0; i < 5; i++) {
path.push([
i === 0 ? ''M'' : ''L'',
(Math.cos(((18 + i * 72) * Math.PI) / 180) * w) + x,
(-Math.sin(((18 + i * 72) * Math.PI) / 180) * w) + y,
]);
path.push([
''L'',
(Math.cos(((54 + i * 72) * Math.PI) / 180) * w) / 2 + x,
(-Math.sin(((54 + i * 72) * Math.PI) / 180) * w) / 2 + y,
]);
}
path.push([''Z'']);
return path;
}
好了,今天的介绍就到这里了。整体不复杂 (╹▽╹)。 期待大家发挥自己的想象力,制造更多有趣的水波图 ❤ ❤ ❤
更多
文章中的一些链接汇总
- G2Plot 水波图 图表指引
- G2Plot 水波图 API 文档
- Path 绘图指令 ☞ G | Path (G 是 AntV 下一款易用、高效、强大的 2D 可视化渲染引擎)
(15)各种Button 与排列 OutlineButton,ButtonBar,Expanded,RaisedButton,StadiumBorder,FlatButton.icon
效果
至于倒数第二行和倒数第一行的效果为啥一样。。可能是fluttersdk升级了。。之前的api不再生效。。算是留坑!
代码
import ''package:flutter/material.dart'';
class ButtonDemo extends StatelessWidget {
@override
Widget build(BuildContext context) {
final Widget _floatButtonDemo =
Row(mainAxisAlignment: MainAxisAlignment.center, children: [
FlatButton(
onPressed: () {},
child: Text("FlatButton"),
splashColor: Colors.grey,
textColor: Theme.of(context).accentColor,
color: Colors.black87,
),
FlatButton.icon(
icon: Icon(Icons.add),
onPressed: () {},
label: Text("FlatButton.icon"),
splashColor: Colors.grey,
textColor: Theme.of(context).accentColor,
color: Colors.black87,
)
]);
final Widget _raisedButtonDemo =
Row(mainAxisAlignment: MainAxisAlignment.center, children: [
Theme(
// data: ThemeData(),
data: Theme.of(context).copyWith(
buttonColor: Theme.of(context).accentColor,
buttonTheme: ButtonThemeData(
textTheme: ButtonTextTheme.primary,
// shape: BeveledRectangleBorder(borderRadius: BorderRadius.circular(5.0)),
shape: StadiumBorder(),
)),
child: RaisedButton(
onPressed: () {},
child: Text("RaisedButton"),
splashColor: Colors.grey,
textColor: Theme.of(context).accentColor,
// color: Colors.white,
// textTheme: ButtonTextTheme.primary,
elevation: 0.0,
)),
SizedBox(
width: 16.0,
),
RaisedButton.icon(
icon: Icon(Icons.add),
onPressed: () {},
label: Text("RaisedButton.icon"),
splashColor: Colors.grey,
textColor: Theme.of(context).accentColor,
elevation: 12.0,
)
]);
final Widget _outerLineButtonDemo =
Row(mainAxisAlignment: MainAxisAlignment.center, children: [
Theme(
// data: ThemeData(),
data: Theme.of(context).copyWith(
buttonColor: Theme.of(context).accentColor,
buttonTheme: ButtonThemeData(
textTheme: ButtonTextTheme.primary,
// shape: BeveledRectangleBorder(borderRadius: BorderRadius.circular(5.0)),
shape: StadiumBorder(),
)),
child: OutlineButton(
onPressed: () {},
child: Text("OutlineButton"),
splashColor: Colors.grey[100],
textColor: Colors.black,
borderSide: BorderSide(color: Colors.black),
highlightedBorderColor: Colors.grey,
// textTheme: ButtonTextTheme.primary,
)),
SizedBox(
width: 16.0,
),
OutlineButton.icon(
icon: Icon(Icons.add),
onPressed: () {},
label: Text("OutlineButton.icon"),
splashColor: Colors.grey,
textColor: Theme.of(context).accentColor,
)
]);
final Widget _widthOuterLineButton = Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
width: 200,
child: OutlineButton(
onPressed: () {},
child: Text("_widthOuterLineButton"),
splashColor: Colors.grey,
textColor: Colors.blue,
),
)
],
);
final Widget _expendOuterLineButton = Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: OutlineButton(
onPressed: () {},
child: Text("_expendOuterLineButton"),
splashColor: Colors.grey,
textColor: Colors.blue,
),
)
],
);
final Widget _expend2OuterLineButton = Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
flex: 1,
child: OutlineButton(
onPressed: () {},
child: Text("权重 for 1"),
splashColor: Colors.grey,
textColor: Colors.blue,
),
),
SizedBox(
width: 15,
),
Expanded(
//权重属性
flex: 2,
child: OutlineButton(
onPressed: () {},
child: Text("权重 for 2"),
splashColor: Colors.grey,
textColor: Colors.blue,
),
)
],
);
//一行并列行显示的按钮
final Widget _buttonBar = Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ButtonBar(
children: [
OutlineButton(
onPressed: () {},
child: Text("ButtonBar"),
splashColor: Colors.grey,
textColor: Colors.blue,
),
OutlineButton(
onPressed: () {},
child: Text("ButtonBar"),
splashColor: Colors.grey,
textColor: Colors.blue,
),
],
)
],
);
//对刚才的并排中间添加边距
final Widget _buttonBarPaddingv = Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Theme(
data: Theme.of(context).copyWith(
buttonTheme: ButtonThemeData(
padding: EdgeInsets.symmetric(horizontal: 100.0))),
child: ButtonBar(
children: [
OutlineButton(
onPressed: () {},
child: Text("ButtonBar"),
splashColor: Colors.grey,
textColor: Colors.blue,
),
OutlineButton(
onPressed: () {},
child: Text("ButtonBar"),
splashColor: Colors.grey,
textColor: Colors.blue,
),
],
),
)
],
);
return Scaffold(
appBar: AppBar(
title: Text("button Demo"),
elevation: 0.0,
),
body: Container(
padding: EdgeInsets.all(16.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
_floatButtonDemo,
_raisedButtonDemo,
_outerLineButtonDemo,
_widthOuterLineButton,
_expendOuterLineButton,
_expend2OuterLineButton,
_buttonBar,
_buttonBarPaddingv
],
),
),
);
}
}
3DMAX如何绘制一个好看的花瓶
图解下异形花瓶的建模方法
1、用线画出花瓶的轮廓半边外形
2、加个车削这样大型就有了
3、 转化多边形模式
4、在多边形模式把上半边选择然后勾选克隆对象分离
5、给上半部分加个 晶格命令
6、最终效果图
Auto CAD2020怎么绘制一个圆与另一个圆相切-Auto CAD2020绘制一个圆与另一个圆相切教程
php小编香蕉带来auto cad2020绘制一个圆与另一个圆相切的教程。在auto cad2020中,绘制一个圆与另一个圆相切是常见的操作,具体步骤和技巧能够帮助您轻松完成这一任务,提高绘图效率。通过本教程,您将学会如何利用auto cad2020的工具和功能,精确地绘制出两个圆相切的效果,让您的绘图更为精准和专业。
第一步:打开Auto CAD2020软件,创建圆形,如图所示。

第二步:点击圆里面的相切,相切,半径,如图所示。

第三步:选择第一个圆的递延切点,如图所示。

第四步:选择第二个圆的递延切点,如图所示。

第五步:输入指定圆的半径参数300,空格,如图所示。

第六步:最后就成功绘制一个圆与另一个圆相切了,如图所示。

上面就是小编为大家带来的Auto CAD2020怎么绘制一个圆与另一个圆相切的全部内容,希望对大家能够有所帮助哦。
以上就是Auto CAD2020怎么绘制一个圆与另一个圆相切-Auto CAD2020绘制一个圆与另一个圆相切教程的详细内容,更多请关注php中文网其它相关文章!
我们今天的关于如何绘制一个圆形button,并在上面做标签和如何绘制一个圆形button,并在上面做标签的分享已经告一段落,感谢您的关注,如果您想了解更多关于 如何绘制一个星星形状的水波图、(15)各种Button 与排列 OutlineButton,ButtonBar,Expanded,RaisedButton,StadiumBorder,FlatButton.icon、3DMAX如何绘制一个好看的花瓶、Auto CAD2020怎么绘制一个圆与另一个圆相切-Auto CAD2020绘制一个圆与另一个圆相切教程的相关信息,请在本站查询。
本文标签: