C#中GraphicsPath的Widen方法用法实例
本文实例讲述了C#中GraphicsPath的Widen方法用法。分享给大家供大家参考。具体如下:
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Drawing.Drawing2D; namespace advanced_drawing { public partial class Form12 : Form { public Form12() { InitializeComponent(); } private void Form12_Paint(object sender, PaintEventArgs e) { // Create a path and add two ellipses. GraphicsPath myPath = new GraphicsPath(); myPath.AddEllipse(0, 0, 100, 100); myPath.AddEllipse(100, 0, 100, 100); // Draw the original ellipses to the screen in black. e.Graphics.DrawPath(Pens.Blue, myPath); // Widen the path. Pen widenPen = new Pen(Color.Black, 10); Matrix widenMatrix = new Matrix(); widenMatrix.Translate(50, 50); myPath.Widen(widenPen, widenMatrix, 1.0f); // Draw the widened path to the screen in red. e.Graphics.FillPath(new SolidBrush(Color.Red), myPath); } } }
希望本文所述对大家的C#程序设计有所帮助。
相关推荐
-
深入c# GDI+简单绘图的具体操作步骤(二)
在上一篇里已经向大家介绍了如何使用GDI+绘制简单的图像,这一片继续向大家介绍其它一些绘图知识.1.首先我们来看下上一片中我们使用过的Pen.Pen的属性主要有: Color(颜色),DashCap(短划线终点形状),DashStyle(虚线样式),EndCap(线尾形状), StartCap(线头形状),Width(粗细)等.我们可以用Pen 来画虚线,带箭头的直线等 复制代码 代码如下: Pen p = new Pen(Color.Blue, 5);//设置笔的粗细为,颜色为蓝色Grap
-
C#中GraphicsPath的AddString方法用法实例
本文实例讲述了C#中GraphicsPath的AddString方法用法.分享给大家供大家参考.具体如下: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Drawing.Drawing2D;
-
C#实现Windows Form调用R进行绘图与显示的方法
一.前提准备 安装R软件,需要安装32位的R软件,64位的调用会报错.另外就是讲R添加到电脑环境变量中. 打开R软件,安装包 scatterplot3d,演示需要用到此R包. 二.创建项目GraphGenerateByR,项目结构如下: 注意:这里需要引入RDotNet类库,可以自行下载:http://rdotnet.codeplex.com/ 三.Main窗体代码 using System; using System.Collections.Generic; using System.Comp
-
深入c# GDI+简单绘图的具体操作步骤(四)
前几篇我已经向大家介绍了如何使用GDI+来绘图,并做了一个截图的实例,这篇我向大家介绍下如何来做一个类似windows画图的工具.个人认为如果想做一个功能强大的绘图工具,那么单纯掌握GDI还远远不够,我的目前也只能做一个比较简单的绘图工具了.不足之处,欢迎大家讨论!先来看一下最终效果吧: 主要实现功能:画直线,矩形,橡皮,圆形,切换颜色,打开图片,保存图片,清除图片,手动调节画布大小;软件刚启动时,为一张空白画布,我们可以直接在画布上绘画,也可以通过菜单中的"打开",导入一张图片,然后
-
C#中GraphicsPath的Warp方法用法实例
本文实例讲述了C#中GraphicsPath的Warp方法用法.分享给大家供大家参考.具体实现方法如下: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Drawing.Drawing2D;
-
深入c# GDI+简单绘图的具体操作步骤(三)
关于这个的例子其实网上已经有这方面的资料了,但是为了文章的完整性,还是觉得有必要讲解.我们先来看一下效果: (图(图1) ( 图2 )接下来看看这是如何做到的.
-
C# GDI在控件上绘图的方法
本文以在chart控件上和窗体上画矩形为例子讲述了C# GDI在控件上绘图的方法.分享给大家供大家参考.具体方法如下: 具体的实现方法就不多解释了,备注很详细,代码也很简单. 主要功能代码如下: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Te
-
C#实现动态数据绘图graphic的方法示例
本文实例讲述了C#实现动态数据绘图graphic的方法.分享给大家供大家参考,具体如下: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Drawing.
-
C#打印绘图的实现方法
本文实例讲述了C#打印绘图的实现方法.分享给大家供大家参考.具体实现方法如下: 复制代码 代码如下: String drawString = ""; Font drawFont = null; SolidBrush drawBrush = null; float x = 0F; float y = 0F; StringFormat drawFormat = new StringFormat(); string test = ""; public string Tes
-
混合语言编程—C#使用原生的Directx和OpenGL绘图的方法
由于项目需要做一些图形展示,所以就想到了使用Directx和OpenGL来绘图,但项目准备使用C#来开发(大家比较熟悉C#),在网上看了相关的资料,有一些第三方的控件可用,试用了下,一运行就占了几百M的内存,而且也不知道是否稳定,教程也少,还不如直接使用原生的.在网上看的Directx和OpenGL的教程基本上都是C/C++的,找了很久也就找到相关介绍,只能自己研究下. 我以前做过C#和C++混合语言编程相关的东西,在C++实现一些C#不好实现的功能,C#动态调用DLL文件,所以也想到了用C++
-
深入c# GDI+简单绘图的具体操作步骤(一)
最近对GDI+这个东西接触的比较多,也做了些简单的实例,比如绘图板,仿QQ截图等. 最早接触这个类,是因为想做仿QQ截图的效果.巧的很,学会了如何做截图后,.NET课堂上老师也正巧要讲关于c#绘图方面的知识,并且我自己又在网上学习金老师的培训班,也是要用到这个类.在学习中有一些体会,所以准备把这些体会记下来,因为内容比较多,可能我会分几次写.废话不多说了,我们先来认识一下这个GDI+,看看它到底长什么样.GDI+:Graphics Device Interface Plus也就是图形设备接口,提
-
C#中GraphicsPath的Flatten方法用法实例
本文实例讲述了C#中GraphicsPath的Flatten方法.分享给大家供大家参考.具体实现方法如下: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Drawing.Drawing2D;
随机推荐
- JS模态窗口返回值兼容问题的完美解决方法
- javascript实现简单的html5视频播放器
- SqlServer表死锁的解决方法分享
- CentOS7下如何配置ip forward(虚拟路由器)
- 解决tomcat部署下的web项目网页更改不能自动刷新的问题
- Oracle随机函数之dbms_random使用详解
- asp.net输出重写压缩页面文件实例代码
- .net 弹出消息框后导致页面样式变乱解决方法
- 对PHP语言认识上需要避免的10大误区
- Go语言中struct的匿名属性特征实例分析
- Asp定时执行操作 Asp定时读取数据库(网页定时操作详解)
- C语言中操作密码文件的一些函数总结
- Android AbsoluteLayout和RelativeLayout布局详解
- 浅谈javascript的调试
- 详解Vue中过度动画效果应用
- 简单示例AJAX结合PHP代码实现登录效果代码
- IIS图片防盗链和下载的解决方案
- 如何从UA分辨出Android设备类型
- spring-cloud入门之spring-cloud-config(配置中心)
- Python使用min、max函数查找二维数据矩阵中最小、最大值的方法