包虫病

首页 » 常识 » 常识 » wpf制作公章圆形环绕字
TUhjnbcbe - 2021/8/2 17:55:00
美丽*皮肤行动 http://m.39.net/news/a_6275901.html

使用WPF制作公章,主要使用到的知识点有:缩放变换,旋转变换的知识。下面附上xaml代码。

Grid!--背景图片,可有可无--Grid.BackgroundLinearGradientBrushGradientStopColor="Blue"Offset="0"/GradientStopColor="yellow"Offset="0.5"/GradientStopColor="Red"Offset="1"//LinearGradientBrush/Grid.BackgroundGrid.Resources!--定义label的样式--StyleTargetType="{x:TypeLabel}"SetterProperty="RenderTransformOrigin"Setter.ValuePointX="0.5"Y="2.5"//Setter.Value/SetterSetterProperty="Width"Value="56"/SetterProperty="Height"Value="50"/SetterProperty="FontSize"Value="30"/SetterProperty="Foreground"Value="#ffff"/SetterProperty="VerticalAlignment"Value="Top"/SetterProperty="RenderTransform"Setter.ValueTransformGroupScaleTransformScaleX="0.6"ScaleY="1"/!--绑定到Tag上,用于旋转的角度--RotateTransformAngle="{BindingTag,RelativeSource={RelativeSourceAncestorType=Label}}"//TransformGroup/Setter.Value/Setter/Style/Grid.Resources!--外侧圆圈--EllipseMargin="0,1,0,0"Height=""Fill="{x:Null}"Stroke="#FFFF"x:Name="EllipseBorder"HorizontalAlignment="Center"VerticalAlignment="Top"Width=""StrokeThickness="1"/!--中间的五角星--PathStrokeThickness="1.00"Stroke="{x:Null}"Fill="#FFFF"Data="F1M55.,1.L68.,40.L.,40.L75.,64.L88.,.L55.,79.L22.,.L34.,64.L1.,40.L42.,40.L55.,1.Z"HorizontalAlignment="Center"RenderTransformOrigin="0.5,0.5"VerticalAlignment="Center"Path.RenderTransformTransformGroupScaleTransformScaleX="0.68"ScaleY="0.68"/SkewTransformAngleX="0"AngleY="0"/RotateTransformAngle="0"/TranslateTransformX="0"Y="0"//TransformGroup/Path.RenderTransform/Path!--下面是一堆文字和角度--LabelContent="我"Tag="10"/LabelContent="是"Tag="30"/LabelContent="一"Tag="50"/LabelContent="只"Tag="70"/LabelContent="快"Tag="90"/LabelContent="乐"Tag=""/LabelContent="的"Tag=""/LabelContent="小"Tag=""/LabelContent="*"Tag=""/LabelContent="鸭"Tag=""/LabelContent="*"Tag=""/LabelContent="*"Tag=""/LabelContent="*"Tag=""/LabelContent="*"Tag=""/LabelContent="*"Tag=""/LabelContent="*"Tag=""/LabelContent="~"Tag=""/LabelContent="~"Tag=""//Grid

大致效果已经出来了,其它美化就要你们自己动手啦~

效果图:

想进技术交流群的加

1
查看完整版本: wpf制作公章圆形环绕字