WPF 布局

了解

WPF中所有布局如下,我们一一尝试实现,本文档主要以图形化的形式展示每个布局的功能。

  • 布局: Border、 BulletDecorator、 Canvas、 DockPanel、 Expander、 Grid、 GridView、 GridSplitter、 GroupBox、 Panel、 ResizeGrip、 Separator、 ScrollBar、 ScrollViewer、 StackPanel、 Thumb、 Viewbox、 VirtualizingStackPanel、 Window和 WrapPanel。

布局

Border(边框)

主要用于绘制另一个元素四周的边框和/或背景样式。

Border 只能有一个子级。 若要显示多个子元素,需要在父 Border内放置一个附加Panel元素。 然后,可以在该 Panel 元素中放置子元素。(以下展示存放两个元素,就会出现报错)

如果要在内容周围显示边框,必须将元素放在父 Border 元素中。

效果

代码

        <!--margin为外边距-->
        <!--borderthickness为边框的厚度-->
        <Border BorderBrush="Green" BorderThickness="10" Margin="10,10,663,322" Background="Gray">
            <Label Content="border展示"/>
        </Border>

BulletDecorator(子弹头装饰)

表示一个布局控件,该控件将项目符号与另一个可视对象对齐。

 BulletDecorator简单来说就是用来控制项目布局的,其布局方式分为:从左往右(默认)、从右往左;是通过FlowDirection属性来设置的;

效果

可能遇到的问题

读者如果遇到运行前图片可以显示但是运行后图片显示不了的情况,右键图片属性将其生成操作更改为资源,并重写生成项目解决方案

 BulletDecorator只能添加一个子元素,可以配合WrapPanel、StackPanel等控件一起使用,进行布局。

代码

        <!--VerticalAlignment垂直对齐-->
        <BulletDecorator Margin="0,118,0,0" VerticalAlignment="Top" Background="Yellow">
            <BulletDecorator.Bullet>
                <Image Source="images\Z_W_H_.png" Height="20"/>
            </BulletDecorator.Bullet>
            <!--TextWrapping文字换行 NoWrap不进行换行将所有元素都显示在同一行上 Wrap按字符换行 WrapWithOverflow按空格换行,并且即使该单词显示不出来也不换行-->
            <TextBlock FontSize="20" Width="264" TextWrapping="NoWrap" HorizontalAlignment="Left" Foreground ="Purple">
                A Simple BulletDecorator
            </TextBlock>
        </BulletDecorator>
        <BulletDecorator Margin="0,148,0,0" VerticalAlignment="Top" Background="Yellow" FlowDirection="RightToLeft">
            <BulletDecorator.Bullet>
                <Image Source="images\Z_W_H_.png" Height="20"/>
            </BulletDecorator.Bullet>
            <!--TextWrapping文字换行 NoWrap不进行换行将所有元素都显示在同一行上 Wrap按字符换行 WrapWithOverflow按空格换行,并且即使该单词显示不出来也不换行-->
            <TextBlock FontSize="20" Width="264" TextWrapping="NoWrap" HorizontalAlignment="Left" Foreground ="Purple">
                A Simple BulletDecorator
            </TextBlock>
        </BulletDecorator>

Canvas(画布)

定义一个区域,可在其中使用相对于 Canvas 区域的坐标以显式方式来定位子元素。通过top,left,bottom,right设置相对于父元素的位置

效果

代码

        <Canvas Margin="10,178,554,42">
            <Canvas Height="100" Width="100" Top="0" Left="0" Background="Red"/>
            <Canvas Height="100" Width="100" Top="100" Left="100" Background="Green"/>
            <Canvas Height="100" Width="100" Top="50" Left="50" Background="Blue"/>
        </Canvas>

DockPanel(停靠面板)

定义一个区域,从中可以按相对位置水平或垂直排列各个子元素。

停靠面板类似于WinForm中控件的Dock属性。DockPanel会对每个子元素进行排序,并将根据指定的边进行停靠,多个停靠在同侧的元素则按顺序排序。在DockPanel中,指定停靠边的控件,会根据定义的顺序占领边角,所有控件绝不会交叠。

默认情况下,后添加的元素只能使用剩余空间,无论对DockPanel的最后一个子元素设置任何停靠值,该子元素都将始终填满剩余的空间。如果不希望最后一个元素填充剩余区域,可以将DockPanel属性LastChildFill设置为false,还必须为最后一个子元素显式指定停靠方向。

效果一

代码一

        <DockPanel Margin="526,285,0,0">
            <Button DockPanel.Dock="Left" Content="ButtonLeft"></Button>
            <Button DockPanel.Dock="Top" Content="ButtonTop"></Button>
            <Button DockPanel.Dock="Right" Content="ButtonRight"></Button>
            <Button DockPanel.Dock="Bottom" Content="ButtonBottom"></Button>
            <Button  Content="ButtonTop"></Button>
        </DockPanel>

效果二

代码二

        <DockPanel LastChildFill="False" Margin="165,285,279,0" >
            <Button DockPanel.Dock="Left" Content="ButtonLeft"></Button>
            <Button DockPanel.Dock="Top" Content="ButtonTop"></Button>
            <Button DockPanel.Dock="Right" Content="ButtonRight"></Button>
            <Button DockPanel.Dock="Bottom" Content="ButtonBottom"></Button>
            <Button  DockPanel.Dock="Top" Content="最后一个Button不填充剩余空间"></Button>
        </DockPanel>

Expander(扩展器)

表示一种控件,该控件显示具有可折叠内容显示窗口的标题。

效果

代码

        <!--HorizontalAlignment水平对齐-->
        <!--ExpandDirection内容窗口的打开方向-->
        <!--Header设置控件的标题-->
        <!--IsExpanded初始的时候窗口是否可见-->
        <Expander Name="myExpander" Background="Tan"  HorizontalAlignment="Left" Header="My Expander"  ExpandDirection="Down" IsExpanded="True" Width="100" Margin="165,10,0,322">
            <TextBlock TextWrapping="Wrap">
                Lorem ipsum dolor sit amet, consectetur
                adipisicing elit, sed do eiusmod tempor incididunt ut
                labore et dolore magna aliqua
            </TextBlock>
        </Expander>

Grid(网格)

定义由列和行组成的灵活的网格区域。

效果

代码

        <!--ShowGridLines网格线在此 Grid 中是否可见。-->
        <Grid VerticalAlignment="Top" HorizontalAlignment="Left" ShowGridLines="True" Width="250" Height="100" Margin="362,13,0,0">
            <!--ColumnDefinitions列定义-->
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <!--RowDefinitions行定义-->
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition />
                <RowDefinition />
                <RowDefinition />
            </Grid.RowDefinitions>
            <!--ColumnSpan指示 Grid 中的子内容所跨越的总列数。-->
            <TextBlock FontSize="20" FontWeight="Bold" Grid.ColumnSpan="3" Grid.Row="0">2005 Products Shipped</TextBlock>
            <!--Row显示 Grid 中的哪个子内容行。-->
            <!--Column显示 Grid 中的子内容的列。-->
            <!--FontWeight指定所需的字体粗细-->
            <TextBlock FontSize="12" FontWeight="ExtraLight" Grid.Row="1" Grid.Column="0">Quarter 1</TextBlock>
            <TextBlock FontSize="12" FontWeight="Black" Grid.Row="1" Grid.Column="1">Quarter 2</TextBlock>
            <TextBlock FontSize="12" FontWeight="Bold" Grid.Row="1" Grid.Column="2">Quarter 3</TextBlock>
            <TextBlock Grid.Row="2" FontWeight="DemiBold" Grid.Column="0">50000</TextBlock>
            <TextBlock Grid.Row="2" FontWeight="ExtraBlack" Grid.Column="1">100000</TextBlock>
            <TextBlock Grid.Row="2" FontWeight="ExtraBold" Grid.Column="2">150000</TextBlock>
            <TextBlock FontSize="16" FontWeight="Heavy" Grid.ColumnSpan="3" Grid.Row="3">Total Units: 300000</TextBlock>
        </Grid>

GridView(显示数据表格)

表示 ListView 控件的以列形式显示数据项的视图模式。

GridView视图模式是ListView控件的视图模式中的一种。

效果

代码

前端
        <ListView x:Name="UserListView"  Margin="236,148,350,156">
            <ListView.View>
                <GridView>
                    <GridView.Columns>
                        <GridViewColumn DisplayMemberBinding="{Binding UserName}" Header="用户名"/>
                        <GridViewColumn DisplayMemberBinding="{Binding Password}" Header="密码"/>
                        <GridViewColumn DisplayMemberBinding="{Binding Level}" Header="权限等级"/>
                    </GridView.Columns>
                </GridView>
            </ListView.View>
        </ListView>
后台
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            UserListView.ItemsSource = GetNameList();
        }
        public List<UserList> GetNameList()
        {
            List<UserList> list = new List<UserList>();
            list.Add(new UserList() { Level = 1, UserName = "John", Password = "Doe" });
            list.Add(new UserList() { Level = 2, UserName = "Jane", Password = "Doe" });
            list.Add(new UserList() { Level = 3, UserName = "Tom", Password = "Smith" });
            list.Add(new UserList() { Level = 4, UserName = "Jerry", Password = "Wang" });
            list.Add(new UserList() { Level = 5, UserName = "Linda", Password = "Li" });
            return list;
        }
    }
    public class UserList
    { 

        public string UserName { get;set; }
        public string Password { get;set; }
        public int Level {get;set; }
    }

GridSplitter

表示重新分布 Grid 控件的列间距或行间距的控件。

效果

代码

        <Grid Margin="487,217,67,176" ShowGridLines="True" Background="AliceBlue">
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <!--通过 GridSplitter 覆盖列的边缘来调整 中 Grid 列的大小。-->
            <GridSplitter Grid.Column ="0" Background="Blue" Height="10" HorizontalAlignment="Stretch" VerticalAlignment="Top"/>
            <GridSplitter Grid.Column ="0" Background="Blue" Width="10" HorizontalAlignment="Right" VerticalAlignment="Stretch"/>
            <GridSplitter Grid.Column ="0" Background="Blue" Width="10" HorizontalAlignment="Left" VerticalAlignment="Stretch"/>
            <GridSplitter Grid.Column ="1" Background="Blue" Width="10" HorizontalAlignment="Right" VerticalAlignment="Stretch"/>
            <Border Grid.Row="0" Grid.Column="0" BorderBrush="Red" BorderThickness="2"></Border>
        </Grid>
        <Grid Margin="514,63,40,330" ShowGridLines="True" Background="AliceBlue">
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <!--定义 一个 GridSplitter ,以重设中的 Grid 列大小,并占用 中的 Grid列。-->
            <!--ShowsPreview指示 GridSplitter 控件在用户拖动控件时是否更新列大小或行大小。-->
            <GridSplitter Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Stretch" Background="Black"  ShowsPreview="True" Width="5" />
            <Border Grid.Row="0" Grid.Column="0" BorderBrush="Red" BorderThickness="2"></Border>
        </Grid>

GroupBox

表示一个控件,该控件用于创建具有用户界面 (UI) 内容边框和标题的容器。

效果

代码

前端
        <GroupBox Margin="1070,0,685,0">
            <GroupBox.Header>
                <Label>Employee Data</Label>
            </GroupBox.Header>
            <StackPanel>
                <TabControl Name="myTabControl" TabStripPlacement="Top"  Margin="0, 0, 0, 10" Height="350" >
                    <TabItem Name="PersonalInfo">
                        <TabItem.Header>_Personal Info</TabItem.Header>
                        <StackPanel>
                            <TextBlock>Employee</TextBlock>
                            <TextBlock>Select your name</TextBlock>
                            <ListBox Name="empName" SelectionChanged="updateSummary">
                                <ListBoxItem IsSelected="true">Esther</ListBoxItem>
                                <ListBoxItem>George</ListBoxItem>
                                <ListBoxItem>Alan</ListBoxItem>
                                <ListBoxItem>Eric</ListBoxItem>
                            </ListBox>
                        </StackPanel>
                    </TabItem>
                    <TabItem>
                        <TabItem.Header>_Job Info</TabItem.Header>
                        <StackPanel>
                            <TextBlock>Select a job</TextBlock>
                            <ListBox Name ="job" SelectionChanged="updateSummary">
                                <ListBoxItem IsSelected="true">Programmer</ListBoxItem>
                                <ListBoxItem>Tester</ListBoxItem>
                                <ListBoxItem>Writer</ListBoxItem>
                                <ListBoxItem>Manager</ListBoxItem>
                            </ListBox>
                        </StackPanel>
                    </TabItem>
                    <TabItem Name="Skill">
                        <TabItem.Header>_Skill</TabItem.Header>
                        <StackPanel>
                            <TextBlock>
                Select your strongest skill
                            </TextBlock>
                            <ListBox Name="skills" SelectionChanged="updateSummary">
                                <ListBoxItem IsSelected="true">C#</ListBoxItem>
                                <ListBoxItem>Visual Basic</ListBoxItem>
                                <ListBoxItem>.NET</ListBoxItem>
                                <ListBoxItem>JScript</ListBoxItem>
                            </ListBox>
                        </StackPanel>
                    </TabItem>
                    <TabItem Name="Summary" >
                        <TabItem.Header>Su_mmary</TabItem.Header>
                        <StackPanel>
                            <TextBlock Name="emp"/>
                            <TextBlock Name="ejob"/>
                            <TextBlock Name="eskill"/>
                        </StackPanel>
                    </TabItem>
                </TabControl>
                <Button Content="Show Summary" Click="goToSummaryTab"/>
            </StackPanel>
        </GroupBox>

Panel

为所有 Panel 元素提供基类。 使用 Panel 元素放置和排列 WPF应用程序中的子对象。

效果

代码

        <StackPanel Margin="832,48,1083,288">
            <Button>Button 1</Button>
            <Button>Button 2</Button>
        </StackPanel>

ResizeGrip

表示 Thumb 控件的一种实现,该控件使 Window 能改变其自身的大小。

ResizeGrip 定义为 的可视化树的一 Window部分。

效果

代码

Separator

用于分隔项控件中各个项的控件。

效果

代码

        <ToolBarTray Background="White" Margin="839,131,1083,276">
            <ToolBar Band="1" BandIndex="1">
                <Button Content="1"></Button>
                <Button  Content="1"></Button>
                <Button  Content="1"></Button>
                <Separator/>
                <Button  Content="1"></Button>
                <Button  Content="1"></Button>
                <Button  Content="1"></Button>
                <Separator/>
                <Button  Content="1"></Button>
                <Button  Content="1"></Button>
            </ToolBar>
        </ToolBarTray>

ScrollBar

表示提供滚动条的控件,该滚动条具有一个滑动 Thumb,其位置对应于一个值。

效果

代码

<ScrollBar Orientation="Horizontal" Width ="4in"
           Scroll="OnScroll" Minimum="1" Maximum="100" />

ScrollViewer

表示可包含其他可视元素的可滚动区域。

效果

代码

        <ScrollViewer HorizontalScrollBarVisibility="Auto" Margin="1446,28,421,197">
            <StackPanel VerticalAlignment="Top" HorizontalAlignment="Left">
                <TextBlock TextWrapping="Wrap" Margin="0,0,0,20">Scrolling is enabled when it is necessary. 
      Resize the window, making it larger and smaller.</TextBlock>
                <Rectangle Fill="Red" Width="500" Height="500"></Rectangle>
            </StackPanel>
        </ScrollViewer>

StackPanel

 效果

代码

        <StackPanel Margin="832,48,1083,288">
            <Button>Button 1</Button>
            <Button>Button 2</Button>
        </StackPanel>

Thumb

表示可以由用户拖动的控件。 Thumb还可用于调整控件的大小。 例如, Thumb 窗口一角的控件可以提供一个位置,供用户使用鼠标单击以开始调整大小操作。

效果

代码

Viewbox

定义一个内容修饰器,以便拉伸或缩放单一子项使其填满可用的控件。

效果

代码

VirtualizingStackPanel

在水平或垂直的一行中排列并显示内容。

效果

代码

Window(窗口)

提供创建、配置、显示和管理窗口和对话框的生存期的能力。

我们新建一个wpf应用程序后,就包含一个window布局元素

用户与独立应用程序之间的交互点是一个窗口。

效果

代码

<Window x:Class="WpfApp2.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:WpfApp2"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800">

</Window>

WrapPanel

按从左到右的顺序位置定位子元素,在包含框的边缘处将内容切换到下一行。 后续排序按照从上至下或从右至左的顺序进行,具体取决于 Orientation 属性的值。

效果

代码

        <Border HorizontalAlignment="Left" VerticalAlignment="Top" BorderBrush="Black" BorderThickness="2" Margin="1766,88,0,0">
            <WrapPanel Background="LightBlue" Width="200" Height="100">
                <Button Width="200">Button 1</Button>
                <Button>Button 2</Button>
                <Button>Button 3</Button>
                <Button>Button 4</Button>
            </WrapPanel>
        </Border>

参考文献

WPF 介绍 | Microsoft Learn

WPF 介绍 | Microsoft Learn

WPF图片问题:运行前可以看见,运行后不见了_wpf运行图片不显示-CSDN博客

WPF教程四:布局之DockPanel面板 - .NET开发菜鸟 - 博客园 (cnblogs.com)

C# Wpf Binding 使用详解_c# binding-CSDN博客

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/310687.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

【软件测试作业_TPshop商城】农业工程学院-测试需求分析与测试计划+自动化+性能+测试用例+报告软件缺陷+测试计划+单元测试+系统测试

1测试需求分析与测试计划 1.1 被测系统简介 1.2测试需求分析 1.2.1单元测试层面的测试需求分析 1.2.2系统测试层面的测试需求分析 1.3测试计划 1.31测试范围与任务 1.3.2 测试环境 1.3.3测试进度安排 测试用例的设计2 2.1单元测试层面的测试用例设计 2.2系统测试层面的测试用例…

Redis:原理速成+项目实战——Redis实战10(Redis消息队列实现异步秒杀)

&#x1f468;‍&#x1f393;作者简介&#xff1a;一位大四、研0学生&#xff0c;正在努力准备大四暑假的实习 &#x1f30c;上期文章&#xff1a;Redis&#xff1a;原理速成项目实战——Redis实战9&#xff08;秒杀优化&#xff09; &#x1f4da;订阅专栏&#xff1a;Redis&…

zookerper入门

zookerper介绍 ZooKeeper 是一个开源的分布式协调框架,主要用来解决分布式集群中应用系统的一致性问题. ZooKeeper本质上是一个分布式的小文件存储系统&#xff08;Zookeeper文件系统监听机制&#xff09;.提供基于类似于文件系统的目录树方式的数据存储&#xff0c;并且可以…

PFA试剂瓶——实验室存储运输化学试剂样品容器

PFA是一种高性能的塑料材料。它是一种热塑性塑料&#xff0c;由全氟化&#xff0c;聚合物制成&#xff0c;具有高度的化学稳定性性。由于其优异的性能&#xff0c;PFA被广泛应用于多个领域&#xff0c;尤其是作为存储和运输各种化学试剂的容器&#xff0c;耐受-200℃至260C的温…

闩锁效应(Latch-up)

闩锁效应&#xff08;Latch-up&#xff09;原理解析 什么是闩锁效应&#xff08;Latch-up&#xff09;&#xff1f; 在CMOS N阱设计中&#xff0c;实际上是由于CMOS电路中基极和集电极相互连接的两个PNP和NPN双极性BJT管子(下图中&#xff0c;侧面式NPN和垂直式PNP)的回路放大…

AI实景自动直播项目怎么样?解决实体行业直播难题!

在如今的互联网时代&#xff0c;作为实体老板想要在激烈的同行竞争中占领优势&#xff0c;那短视频和直播必然是要做的推广渠道之二&#xff0c;但是最近短视频流量持续下滑&#xff0c;带来的订单量越来越少&#xff0c;必然直播将成为常态化的宣传动作&#xff0c;如今抖捧AI…

Allure07-动态生成用例标题

Allure07-动态生成用例标题 高清B站链接 Allure报告清空上一次运行的记录 使用pytest-h 可以查勘报告相关的三个参数 reporting 报告相关参数 –alluredirDIR 指定报告的目录路径 –clean-alluredir 如果已经存在报告&#xff0c;就先清空它 –allure-no-capture 不加载 log…

Ubuntu 22.04.3 LTS arm64 aarch64 ISO jammy-desktop-arm64.iso 下载

Ubuntu 22.04.3 LTS (Jammy Jellyfish) Daily Build 参考 Are there official Ubuntu ARM / aarch64 desktop images? - Ask Ubuntu

Linux第26步_在虚拟机中安装stm32wrapper4dbg工具

在Ubuntu下编译TF-A 或者 Uboot时&#xff0c;我们需要用到ST公司提供的stm32wrapper4dbg工具。stm32wrapper4dbg工具的源码下载地址为: GitHub - STMicroelectronics/stm32wrapper4dbg 记得我们在前面已经创建过的目录如下&#xff1a; 1&#xff09;、在根目录下&#xf…

0 ZigBee无线通信概念实验、抓包

胜达电子学习笔记&#xff1a;lesson5 ZigBee无线通信概念实验、抓包 5.无线通信概论5.1 理解 Lesson5-Sendmain&#xff1a;主函数halRfInit&#xff1a;射频初始化RFSend&#xff1a;无线数据发送出去SendPacket 数组 5.2 理解 Lesson5-ReceiveRevRFProc() 无线接收函数 5.3…

C#基础:通过QQ邮件发送验证码到指定邮箱

一、控制台程序 using System; using System.Net; using System.Net.Mail;public class EmailSender {public void SendEmail(string toAddress, string subject, string body){// 设置发件人邮箱地址以及授权码string fromAddress "xxxxxqq.com";string password …

SIT1050ISO具有隔离功能,1Mbps,高速 CAN 总线收发器

➢ 完全兼容“ ISO 11898 ”标准&#xff1b; ➢ 内置过温保护&#xff1b; ➢ 100kV/s 瞬态抗扰度&#xff1b; ➢ 显性超时功能&#xff1b; ➢ -40V 至 40V 的总线故障保护&#xff1b; ➢ I/O 电压范围支持 3.3V 和 5V MCU &#xff1b; ➢ 低环路延迟…

MS6001S1A低功耗、低噪声 CMOS 轨到轨输入输出运算放大器

MS6001S1A 运算放大器具有极低功耗&#xff0c;轨到轨输入输出&#xff0c;低 的输入失调电压和低的电流噪声。具体表现为可工作在幅度为 1.8V 到 5V 的单电源或者双电源条件&#xff0c;低功耗和低噪声使得 MS6001S1A 能够用在可移动设备上&#xff0c;输入输出的轨到…

【YOLO系列】 Smooth L1 Loss、IOU、GIOU、DIOU、CIOU(附代码实现)

Smooth L1 Loss、IOU、GIOU、DIOU和CIOU都是用于评估模型预测准确性的指标&#xff0c;但它们在计算方式和应用场景上有所不同。 一、Smooth L1 Loss Smooth L1 Loss主要用于回归问题&#xff0c;是由微软的Ross Girshick大神在Fast R-CNN论文中提出的。将Smooth L1 Loss之前应…

vue.js环境在window和linux安装

nodei官网&#xff1a;https://nodejs.org/en/download/ 一.windows环境下安装vue 1&#xff1a;node安装 在node.js的官网上下载node的安装包&#xff0c;下载下来之间安装即可&#xff0c;在命令行输入 npm -vnode -v 如下表示安装成功 2&#xff1a;cnpm安装 npm inst…

怎么修改照片尺寸的?分享3个实用的工具!

在数字时代&#xff0c;照片已经成为我们记录生活、分享经历的重要方式。然而&#xff0c;不同的平台和应用对照片尺寸的要求各不相同&#xff0c;这就需要我们经常对照片进行修改。本文将为您介绍如何修改照片尺寸&#xff0c;以及一些实用的工具。 一、手机应用 手机应用同样…

Backtrader 文档学习-Strategy with Signals

Backtrader 文档学习-Strategy with Signals backtrader可以不通过重写策略的方式触发交易&#xff0c;尽管重写策略是首选通用的方式。 下面介绍通过使用信号也是可以实现交易触发的。 1.定义signal import backtrader as btdata bt.feeds.OneOfTheFeeds(datanamemydatana…

非常好用的个人工作学习记事本Obsidian

现在记事本有两大流派&#xff1a;Obsidian 和Notion&#xff0c;同时据说logseq也很不错 由于在FreeBSD下后两种都没有相关ports&#xff0c;所以优先尝试使用Obsidian Obsidian简介 Obsidian是基于Markdown文件的本地知识管理软件&#xff0c;并且开发者承诺Obsidian对于个…

手机直连卫星及NTN简介

一、手机直连卫星的发展现状 近日&#xff0c;华为推出了支持北斗卫星短报文的Mate 50旗舰机、P60系列&#xff0c;苹果也跟Globalstar&#xff08;全球星&#xff09;合作推出了支持卫星求救的iPhone14&#xff0c;最亮眼的还是华为的。这几款产品揭开了卫星通信探索消费领域…

Aigtek高压放大器的工作原理和指标应用介绍

高压放大器是一种用于放大高压信号的电子设备&#xff0c;具有高压输出&#xff0c;低噪声&#xff0c;高精度&#xff0c;高稳定性&#xff0c;高可靠性&#xff0c;低功耗&#xff0c;低成本等的优点&#xff0c;所以才被广泛应用在磁场探测、电磁脉冲放大、电磁波放大、电磁…