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#中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#中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;
-
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# GDI+简单绘图的具体操作步骤(二)
在上一篇里已经向大家介绍了如何使用GDI+绘制简单的图像,这一片继续向大家介绍其它一些绘图知识.1.首先我们来看下上一片中我们使用过的Pen.Pen的属性主要有: Color(颜色),DashCap(短划线终点形状),DashStyle(虚线样式),EndCap(线尾形状), StartCap(线头形状),Width(粗细)等.我们可以用Pen 来画虚线,带箭头的直线等 复制代码 代码如下: Pen p = new Pen(Color.Blue, 5);//设置笔的粗细为,颜色为蓝色Grap
-
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#使用原生的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#实现动态数据绘图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#中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+简单绘图的具体操作步骤(四)
前几篇我已经向大家介绍了如何使用GDI+来绘图,并做了一个截图的实例,这篇我向大家介绍下如何来做一个类似windows画图的工具.个人认为如果想做一个功能强大的绘图工具,那么单纯掌握GDI还远远不够,我的目前也只能做一个比较简单的绘图工具了.不足之处,欢迎大家讨论!先来看一下最终效果吧: 主要实现功能:画直线,矩形,橡皮,圆形,切换颜色,打开图片,保存图片,清除图片,手动调节画布大小;软件刚启动时,为一张空白画布,我们可以直接在画布上绘画,也可以通过菜单中的"打开",导入一张图片,然后
-
深入c# GDI+简单绘图的具体操作步骤(三)
关于这个的例子其实网上已经有这方面的资料了,但是为了文章的完整性,还是觉得有必要讲解.我们先来看一下效果: (图(图1) ( 图2 )接下来看看这是如何做到的.
随机推荐
- jquery实现多次上传同一张图片
- php用户注册页面利用js进行表单验证具体实例
- 使用RequireJS库加载JavaScript模块的实例教程
- React利用插件和不用插件实现双向绑定的方法详解
- linux touch,chattr指令详解及用法
- Msd、Undelete命令的使用方法
- iOS新浪微博、腾讯微博分享功能实例
- Pyhton中单行和多行注释的使用方法及规范
- Python实现爬取逐浪小说的方法
- C#实现GZip压缩和解压缩入门实例
- js时间戳格式化成日期格式的多种方法介绍
- Vue异步组件使用详解
- 用jquery存取照片的具体实现方法
- 鼠标事件的screenY,pageY,clientY,layerY,offsetY属性详解
- 微信小程序 使用腾讯地图SDK详解及实现步骤
- 认识w3wp.exe进程,从根本上解决占用资源较大问题
- 如何批量替换相对地址为绝对地址(利用bat批处理实现)
- 浅析Java验证码生成库JCaptcha
- 基于Fedora14下自带jdk1.6版本 安装jdk1.7不识别的解决方法
- C#调用SQL语句时乘号的用法