Visual Studio使用控件DevExpress在xml创建自定义的图形

xml中的代码:

<?xml version="1.0"?>
<Shapes xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <ShapeTemplate Id="Shape0" DefaultSize="80,50" IsQuick="true" Rows="*" Columns="*">
    <Start X="0" Y="0" FillColor="Red" />
    <Line X="0" Y="1" />
    <Line X="1" Y="1" />
    <Line X="1" Y="0" />
    <Line X="0" Y="0" />
    <ConnectionPoints>
      <ShapePoint X="0" Y="0" />
      <ShapePoint X="0.5" Y="0" />
      <ShapePoint X="1" Y="0" />
      <ShapePoint X="1" Y="0.5" />
      <ShapePoint X="1" Y="1" />
      <ShapePoint X="0.5" Y="1" />
      <ShapePoint X="0" Y="1" />
      <ShapePoint X="0" Y="0.5" />
    </ConnectionPoints>
    <Parameters />
  </ShapeTemplate>
  <ShapeTemplate Id="Shape1" DefaultSize="50,80" IsQuick="true" Rows="*" Columns="*">
    <Start X="0" Y="0.17" FillColor="Green" />
    <Arc X="1" Y="0.17" Size="CreateSize([W] / 2, [H] / 6)" Direction="Clockwise"/>
    <Line X="1" Y="1" />
    <Arc X="0" Y="1" Size="CreateSize([W] / 2, [H] / 6)" Direction="Counterclockwise"/>
    <Line X="0" Y="0" />
    <ConnectionPoints>
      <ShapePoint X="0" Y="0" />
      <ShapePoint X="0.5" Y="0" />
      <ShapePoint X="1" Y="0" />
      <ShapePoint X="1" Y="0.5" />
      <ShapePoint X="1" Y="1" />
      <ShapePoint X="0.5" Y="1" />
      <ShapePoint X="0" Y="1" />
      <ShapePoint X="0" Y="0.5" />
    </ConnectionPoints>
    <Parameters />
  </ShapeTemplate>
  <ShapeTemplate Id="Shape2" DefaultSize="50,80" Rows="*" Columns="*">
    <Start X="0" Y="0.5" FillColor="Green" />
    <Arc X="1" Y="0.5" Size="CreateSize([W] / 2, [H] / 2)" Direction="Clockwise"/>
    <Line X="1" Y="1" />
    <Line X="0" Y="1" />
    <Line X="0" Y="0" />
    <ConnectionPoints>
      <ShapePoint X="0" Y="0" />
      <ShapePoint X="1" Y="0" />
      <ShapePoint X="0" Y="1" />
    </ConnectionPoints>
    <Parameters />
  </ShapeTemplate>
  <ShapeTemplate Id="Shape3" DefaultSize="80,80" Rows="*" Columns="*">
    <Start X="0" Y="0.5" FillColor="Green" />
    <Arc X="1" Y="0.5" Size="CreateSize([W] / 2, [H] / 2)" Direction="Clockwise"/>
    <Arc X="0" Y="0.5" Size="CreateSize([W] / 2, [H] / 2)" Direction="Clockwise"/>
    <ConnectionPoints>
      <ShapePoint X="0" Y="0" />
      <ShapePoint X="1" Y="0" />
      <ShapePoint X="0" Y="1" />
    </ConnectionPoints>
    <Parameters />
  </ShapeTemplate>
  <ShapeTemplate Id="Shape4" DefaultSize="80,80" Rows="*" Columns="*">
    <Start X="0.5" Y="0" FillColor="Green" />    
    <Line X="1" Y="1" />
    <Line X="0" Y="1" />
    <Line X="0.5" Y="0" />
    <ConnectionPoints>
      <ShapePoint X="0" Y="0" />
      <ShapePoint X="1" Y="0" />
      <ShapePoint X="0" Y="1" />
    </ConnectionPoints>
    <Parameters />
  </ShapeTemplate>
 <ShapeTemplate Id="Shape5" DefaultSize="80,80" Rows="*" Columns="*">
     <Start X="0" Y="0.5" FillColor="Green" />
    <Arc X="1" Y="0.5" Size="CreateSize([W] / 2, [H] / 4)" Direction="Clockwise"/>
    <Arc X="0" Y="0.5" Size="CreateSize([W] / 2, [H] / 4)" Direction="Clockwise"/>
    <ConnectionPoints>
      <ShapePoint X="0" Y="0" />
      <ShapePoint X="1" Y="0" />
      <ShapePoint X="0" Y="1" />
    </ConnectionPoints>
    <Parameters />
  </ShapeTemplate>
  <ShapeTemplate Id="Shape6" DefaultSize="80,80"  Rows="*" Columns="*">
    <Start X="0.5" Y="0" FillColor="Green" />
    <Line X="0" Y="0.5" />
    <Line X="0.5" Y="1" />
    <Line X="1" Y="0.5" />
    <Line X="0.5" Y="0" />
    <ConnectionPoints>
      <ShapePoint X="0.5" Y="0" />
      <ShapePoint X="0" Y="0.5" />
      <ShapePoint X="0.5" Y="1" />
      <ShapePoint X="1" Y="0.5" />
    </ConnectionPoints>
    <Parameters />
  </ShapeTemplate>
  <ShapeTemplate Id="Shape7" DefaultSize="80,80"  Rows="*" Columns="*">
    <Start X="0.5" Y="0" FillColor="Green" />
    <Line X="1" Y="0.5" />
    <Line X="1" Y="1" />
    <Line X="0" Y="1" />
    <Line X="0" Y="0.5" />
    <Line X="0.5" Y="0" />
    <ConnectionPoints>
      <ShapePoint X="0.5" Y="0" />
      <ShapePoint X="1" Y="0.5" />
      <ShapePoint X="1" Y="1" />
      <ShapePoint X="0" Y="1" />
      <ShapePoint X="0" Y="0.5" />
    </ConnectionPoints>
    <Parameters />
  </ShapeTemplate>
  <ShapeTemplate Id="Shape8" DefaultSize="80,80" Rows="*" Columns="*">
    <Start X="0" Y="1" FillColor="Green" />
    <Line X="0" Y="0.5" />
    <Arc X="1" Y="0.5" Size="CreateSize([W] / 2, [H] / 2)" Direction="Clockwise"/>
    <Line X="1" Y="1" />
    <Line X="0" Y="1" />
    <Line X="0.5" Y="0" />
    <Line X="1" Y="1" />
    <ConnectionPoints>
      <ShapePoint X="0" Y="0.5" />
      <ShapePoint X="0.5" Y="0" />
      <ShapePoint X="1" Y="0.5" />
      <ShapePoint X="1" Y="1" />
      <ShapePoint X="0" Y="1" />
    </ConnectionPoints>
    <Parameters />
  </ShapeTemplate>
  <ShapeTemplate Id="Shape9" DefaultSize="80,80" Rows="*" Columns="*">
    <Start X="0" Y="1" FillColor="Green" />
    <Line X="0" Y="0.5" />
    <Arc X="1" Y="0.5" Size="CreateSize([W] / 2, [H] / 2)" Direction="Clockwise"/>
    <Line X="1" Y="1" />
    <Arc X="0" Y="1" Size="CreateSize([W] / 2, [H] / 6)" Direction="Counterclockwise"/>
    <Start X="0" Y="1" FillColor="Green" />
    <Line X="0.5" Y="0" />
    <Line X="1" Y="1" />
    <Arc X="0" Y="1" Size="CreateSize([W] / 2, [H] / 6)" Direction="Counterclockwise"/>
    <ConnectionPoints>
      <ShapePoint X="0" Y="0.5" />
      <ShapePoint X="1" Y="0.5" />
      <ShapePoint X="1" Y="1" />
      <ShapePoint X="0" Y="1" />
      <ShapePoint X="0.5" Y="0" />
    </ConnectionPoints>
    <Parameters />
  </ShapeTemplate>
  <ShapeTemplate Id="Shape10" DefaultSize="80,80"  Rows="*" Columns="*">
    <Start X="0" Y="0.5" FillColor="Green" />
    <Line X="0.25" Y="0" />
    <Line X="0.75" Y="0" />
    <Line X="1" Y="0.5" />
    <Line X="0.75" Y="1" />
    <Line X="0.25" Y="1" />
    <Line X="0" Y="0.5" />
    <Parameters />
  </ShapeTemplate>
   <ShapeTemplate Id="Shape11" DefaultSize="80,80"  Rows="*" Columns="*">
    <Start X="0" Y="0.25" FillColor="Green" />
    <Line X="0.5" Y="0" />
    <Line X="1" Y="0.25" />
    <Line X="1" Y="0.75" />
    <Line X="0.5" Y="1" />
    <Line X="0" Y="0.75" />
    <Line X="0" Y="0.25" />
    <Parameters />
  </ShapeTemplate>
   
</Shapes>

运行结果:
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值