public partial class CirclePictureBox : PictureBox
     {
         public CirclePictureBox()
         {
             Circle = true;
             InitializeComponent();
         }        

         protected override void OnPaint(PaintEventArgs pe)
         {
             base.OnPaint(pe);
         }

         //圆形大小随控件大小变化
         protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified)
         {
              && height > )
             {
                 CircleSize = new Size(width, height);
             }
             base.SetBoundsCore(x, y, width, height, specified);
         }

         bool _circle;
         [Description(" 获取或设置按钮椭圆效果。"), DefaultValue(true)]
         public bool Circle
         {
             get
             {
                 return _circle;
             }

             set
             {
                 if (value)
                 {
                     GraphicsPath gp = new GraphicsPath();
                     gp.AddEllipse(, , _circleSize.Width, _circleSize.Height);//圆形
                     this.Region = new Region(gp);
                     this.BorderStyle = BorderStyle.None;
                     this.Invalidate();
                 }
                 _circle = value;
             }
         }

         Size _circleSize=,);
         [Description(" 圆形的大小")]
         Size CircleSize
         {
             get
             {
                 return _circleSize;
             }
             set
             {
                 _circleSize = value;
                 Circle = true;
             }
         }
     }

winform 制作圆形图片框的更多相关文章

  1. 【WinRT】【译】【加工】在 XAML 中制作圆形图片

    原文:[WinRT][译][加工]在 XAML 中制作圆形图片 原文地址:http://timheuer.com/blog/archive/2015/05/06/making-circular-ima ...

  2. Glide制作圆形图片

    上效果图: 第一步: AndroidStudio添加依赖库: compile 'com.github.bumptech.glide:glide:3.5.2' 第二步: <ImageView an ...

  3. php 制作圆形图片

    function createRoundImg($imgpath) { $ext = pathinfo($imgpath); $src_img = null; switch ($ext['extens ...

  4. 【2017-05-02】winform弹出警告框是否进行增删改操作、记事本制作、对话框控件和输出输入流

    一.winform弹出警告框是否进行增删改操作 第一个参数是弹出窗体显示的内容,第二个参数是标题,第三个参数是该弹窗包含确定和取消按钮. 返回的是一个枚举类接收一下. 再进行判断,如果点的是确定按钮, ...

  5. 【2017-05-02】winform弹出警告框选择性操作、记事本制作、对话框控件和输入输出流

    一.winform弹出警告框选择性操作 MessageBox.Show()返回一个枚举类值(第一个参数为弹出窗口显示的内容,第二个参数为弹出窗口的标题,第三个参数为弹出窗口包含的按钮) 先新建一个变量 ...

  6. SVG如何做圆形图片

    SVG如何做圆形图片 2016年5月31日17:30:48 提到圆形图片,大家首先想到的一定是border-radius,但在SVG中这些方法很难起效,下面方法适合SVG中制作任意规则与不规则的图形. ...

  7. 如何录屏制作gif图片

    LICEcap简介: LICEcap是一款屏幕录制制作gif图片的工具,支持导出 GIF 动画图片格式,轻量级.使用简单,录制过程中可以随意改变录屏范围. LICEcap 直观易用,功能灵活,支持 W ...

  8. Android View加载圆形图片且同时绘制圆形图片的外部边缘边线及边框:LayerDrawable实现

     Android View加载圆形图片且同时绘制圆形图片的外部边缘边线及边框:LayerDrawable实现 LayerDrawable实现的结果和附录文章1,2,3中的layer-list一致. ...

  9. WPF和Winform中picturebox图片局部放大

    原文:WPF和Winform中picturebox图片局部放大 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/yangyisen0713/artic ...

随机推荐

  1. linux内核内存管理(zone_dma zone_normal zone_highmem)

    Linux 操作系统和驱动程序运行在内核空间,应用程序运行在用户空间,两者不能简单地使用指针传递数据,因为Linux使用的虚拟内存机制,用户空间的数据可能被换出,当内核空间使用用户空间指针时,对应的数 ...

  2. 64位linux报错Could not initialize class java.awt.image.BufferedImage

    最近碰到一个问题: 64位linux报错Could not initialize class java.awt.image.BufferedImage 在WIN平台下运行正常BufferedImage ...

  3. GMap学习笔记

    GMap学习笔记 1.GMap体系详解 What is the map control (GMapControl)? This is the control which renders the map ...

  4. codewars-random(2)

    找出数组中的间谍 思路一:遍历一遍数组,开始前将flag设置为0:将count设为0:每当出现一个奇数(注意负数)count加1,当count大于等于2时将flag至为1: 再遍历一遍数组,如果fla ...

  5. Objective-C运行时态消息传递--拼接方法名

    做IOS开发的人都知道,Objective-C语言中方法的调用是运行时采取绑定的,在编译过程中只声明该方法的存在. 那么我们来简单说下在运行时,类的消息传递. 在运行时,每个方法如[self meth ...

  6. Iperf[转]

    原文链接:https://openmaniak.com/iperf.php Iperf is a tool to measure the bandwidth and the quality of a ...

  7. 【LeetCode】22. Generate Parentheses (I thought I know Python...)

    I thought I know Python... Actually , I know nothing... 这个题真想让人背下来啊,每一句都很帅!!! Given n pairs of paren ...

  8. 【LeetCode】30. Substring with Concatenation of All Words

    You are given a string, s, and a list of words, words, that are all of the same length. Find all sta ...

  9. volatile(C# 参考)

    本文档已存档,并且将不进行维护. volatile(C# 参考) 若要了解有关 Visual Studio 2017 RC 的最新文档,请参阅 Visual Studio 2017 RC 文档. vo ...

  10. POJ 1952 BUY LOW, BUY LOWER

    $dp$. 一开始想了一个$dp$做法,$dp[i][j]$表示前$i$个数字,下降序列长度为$j$的方案数为$dp[i][j]$,这样做需要先离散化然后用树状数组优化,空间复杂度为${n^2}$,时 ...