上一页 1 2 3 4 5 6 7 ··· 52 下一页

2012年7月26日

画刷和画刷类型

摘要: 1.SolidBrush(单色画刷)它是一种一般的画刷,通常只用一种颜色去填充GDI+图形,例如: protected override void OnPaint(PaintEventArgs e) { Graphics g = e.Graphics; SolidBrush sdBrush1 = new SolidBrush(Color.Red); SolidBrush sdBrush2 = new SolidBrush(Color.Green); SolidBrush sdBrush3 = ... 阅读全文

posted @ 2012-07-26 11:21 流星落 阅读(615) 评论(0) 推荐(0) 编辑

基本图形绘制举例

摘要: 1.画一个矩形引用命名空间using System.Drawing.Drawing2D; protected override void OnPaint(PaintEventArgs e) { Graphics g = e.Graphics; Rectangle rect = new Rectangle(50, 30, 100, 100); LinearGradientBrush lBrush = new LinearGradientBrush(rect, Color.Red, Color.Yello... 阅读全文

posted @ 2012-07-26 09:08 流星落 阅读(272) 评论(0) 推荐(0) 编辑

2012年7月25日

c# GDI+简单绘图(二)

摘要: 在上一片里已经向大家介绍了如何使用GDI+绘制简单的图像,这一片继续向大家介绍其它一些绘图知识.1.首先我们来看下上一片中我们使用过的Pen.Pen的属性主要有: Color(颜色),DashCap(短划线终点形状),DashStyle(虚线样式),EndCap(线尾形状), StartCap(线头形状),Width(粗细)等.我们可以用Pen 来画虚线,带箭头的直线等Penp=newPen(Color.Blue,5);//设置笔的粗细为,颜色为蓝色Graphicsg=this.CreateGraphics();//画虚线p.DashStyle=DashStyle.Dot;//定义虚线的样式为 阅读全文

posted @ 2012-07-25 15:30 流星落 阅读(414) 评论(0) 推荐(0) 编辑

c# GDI+简单绘图(一)

摘要: 最近对GDI+这个东西接触的比较多,也做了些简单的实例,比如绘图板,仿QQ截图等. 最早接触这个类,是因为想做仿QQ截图的效果.巧的很,学会了如何做截图后,.NET课堂上老师也正巧要讲关于c#绘图方面的知识,并且我自己又在网上学习金老师的培训班,也是要用到这个类.在学习中有一些体会,所以准备把这些体会记下来,因为内容比较多,可能我会分几次写. 废话不多说了,我们先来认识一下这个GDI+,看看它到底长什么样.GDI+:Graphics Device Interface Plus也就是图形设备接口,提供了各种丰富的图形图像处理功能;在C#.NET中,使用GDI+处理二维(2D)的图形和图像,使.. 阅读全文

posted @ 2012-07-25 14:45 流星落 阅读(321) 评论(0) 推荐(0) 编辑

GDI+编程---坐标系统

摘要: 在绘图时,常常用3种结构指定坐标:Point,Size和Rectangle1.PointGDI+使用Point表示一个点。这是一个二维平面上的点----一个像素的表示方式。声明和构造Point的代码如下:Point p=new Point(1,1);2.SizeGDI+使用Size表示一个尺寸(像素).Size结构包含宽度和高度。Size s=new Size(5,5);3.RectangleGDI+在许多不同的地方使用这个结构,以指定矩形的坐标。Rectangle有两个构造函数,一个参数是X坐标,Y坐标,宽度和高度,另一个构造函数的参数是Point和Size结构Rectangle r1=ne 阅读全文

posted @ 2012-07-25 14:08 流星落 阅读(261) 评论(0) 推荐(0) 编辑

GDI+编程---图形绘制概述

摘要: Graphics Device Interface类(GDI+)编程,GDI+是.NET Framework的绘图技术。Graphics类封装了一个GDI+绘图接口。有3个基本类型的绘图接口:1.屏幕上的窗口和控件2.要发送给打印机的页面3.内存中的位图和图像Graphics类提供了在这些绘图界面上绘图的功能。我们可以使用它绘制圆弧、曲线、Bezier曲线、椭圆、图像、线条、矩形和文本。给窗口获得Graphics对象有两种不同的方式。首先是重写OnPaint()事件,利用事件传入的PaintEventArgs中获取Graphics对象:protected override void OnPai 阅读全文

posted @ 2012-07-25 13:47 流星落 阅读(437) 评论(0) 推荐(0) 编辑

2012年7月23日

在没有数据集的情况下使用数据表

摘要: 使用数据适配器填充数据表View Code using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data;using System.Data.SqlClient;namespace PopDataTable{ class Program { static void Main(string[] args) { string connString = @" server =.; ... 阅读全文

posted @ 2012-07-23 15:15 流星落 阅读(193) 评论(0) 推荐(0) 编辑

使用数据集和XML

摘要: 可以使用ReadXml()和WriteXml()方法分别读取数据集中的数据(和模式),写入XML文件。实例:将数据从数据集写到XML文件中View Code using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data;using System.Data.SqlClient;namespace WriteXML{ class Program { static void Main(string[] args) { ... 阅读全文

posted @ 2012-07-23 14:48 流星落 阅读(392) 评论(0) 推荐(0) 编辑

使用SqlCommandBuilder

摘要: 使用命令构造器添加行View Code using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data;using System.Data.SqlClient;namespace PersistAddsBuilder{ class Program { static void Main(string[] args) { string connString = @"server=.; ... 阅读全文

posted @ 2012-07-23 11:59 流星落 阅读(503) 评论(0) 推荐(0) 编辑

DeleteCommand属性---删除数据集指定的行保存到数据源中

摘要: 数据集中删除指定行实例View Code using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data;using System.Data.SqlClient;namespace PersistDeletes{ class Program { static void Main(string[] args) { string connString = @"server=.; i... 阅读全文

posted @ 2012-07-23 11:14 流星落 阅读(833) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 ··· 52 下一页

导航