上一页 1 ··· 3 4 5 6 7 8 下一页
摘要: 用于变换的方法:Graphics g = e.Graphics; g.FillRectangle(Brushes.White, this.ClientRectangle); //first,draw a non-scaled rectangle and circle g.DrawRectangle(Pens.Black, 10, 10, 50, 50); g.DrawEllipse(Pens.Black,10, 10, 10, 10); //now apply the scaling transformation //this will scale subsequent opera... 阅读全文
posted @ 2012-03-14 20:22 ttssrs 阅读(222) 评论(0) 推荐(0) 编辑
摘要: 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.Drawing2D;namespace WindowsFormsApplication2{ public partial class Form1 : Form { private ... 阅读全文
posted @ 2012-03-14 20:22 ttssrs 阅读(2524) 评论(1) 推荐(0) 编辑
摘要: private void Form1_Paint(object sender, PaintEventArgs e) { Graphics g = e.Graphics; g.FillRectangle(Brushes.White, this.ClientRectangle); //create essensial objects for painting text strings SizeF sizeF = g.MeasureString("Test", this.Font); ... 阅读全文
posted @ 2012-03-14 20:12 ttssrs 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 规则形状的裁剪区域 Graphics g = e.Graphics; g.FillRectangle(Brushes.White, this.ClientRectangle); //Define the rectangle that we'll use to define our clipping region Rectangle rect = new Rectangle(10, 10, 80, 50); //Draw the clipping region g.DrawRectangle(Pens.Black, rect); //now apply the clipping re.. 阅读全文
posted @ 2012-03-14 20:11 ttssrs 阅读(218) 评论(0) 推荐(0) 编辑
摘要: GraphicsPath本身是一个由有顺序的一组图形组成的路径,因为这组图形是有顺序的,而且每个图形都由一组有顺序的直线和曲线组成,所以GraphicsPath本身是一个有起点和终点的路径。在一个区域中创建另一个区域:要从以后的区域中创建另一个区域,构造函数不接受已有的区域对象本身,而是接受一个区域数据的数组,我们可以从其GetRegionData方法中获取这个区域所需要的数据,这个方法一RegionData对象的形式返回所需的数据,接着就可以吧这个对象传送给Region构造函数,创建与已有Region对象类似的新Region对象。Region r1 = new Region(new rect 阅读全文
posted @ 2012-03-14 20:10 ttssrs 阅读(254) 评论(0) 推荐(0) 编辑
摘要: string str = "spp"; string spp = "very good";如何由str得到very good?public partial class Form1 : Form { string str = "spp"; public string spp = "very good"; public Form1() { InitializeComponent(); MessageBox.Show(this.GetType().GetField(str).GetValu... 阅读全文
posted @ 2012-03-14 20:09 ttssrs 阅读(333) 评论(0) 推荐(0) 编辑
摘要: 编辑器加载中...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.Drawing2D;using System.Drawing.Imaging;using System.Drawing.Text;namespace WindowsFormsApplica 阅读全文
posted @ 2012-03-14 20:08 ttssrs 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 图像裁剪:Graphics g = e.Graphics; Bitmap bmp = new Bitmap("a.jpg"); g.FillRectangle(Brushes.White, this.ClientRectangle); Rectangle sr = new Rectangle(80, 60, 400, 400); Rectangle dr = new Rectangle(0, 0, 200, 200); g.DrawImage(bmp, dr, sr, GraphicsUnit.Pixel);源矩形定义了修剪后要在原图像中保留的那一部分,目标矩形描述了在绘图 阅读全文
posted @ 2012-03-14 20:07 ttssrs 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 启用制表位应使用StringFormat对象的SetTabStops方法,之后就可以在要绘制的文本中使用制表位了,方法是在文本字符串中包含制表符,然后把文本字符串和StringFormat对象传送给Graphics.DrawString方法。Graphics g = e.Graphics; g.FillRectangle(Brushes.White, this.ClientRectangle); Font f = new Font("Times New Roman", 12); Font bf = new Font(f, FontStyle.Bold); StringFor 阅读全文
posted @ 2012-03-14 20:06 ttssrs 阅读(390) 评论(0) 推荐(0) 编辑
摘要: GDI+提供了两个类可以用于表示图像:Bitmap类和Metafile类,这两个类都继承自Image类。Bitmap类提供了处理位图的功能,位图是基于光栅的图像,这种图像是由放在一个二维网格上的方块像素组成的,网格中的每个像素都有自己的颜色。Metafile类提供了处理矢量图像的功能,在绘图表面上绘制Metafile对象时,它会重放绘图操作,把它们一次应用到绘图表面上。下面的例子创建一个bitmap对象,使用它从文件中把一个位图加载到内存中,接着使用graphics类把内存中的图像显示到绘图表面上: Graphics g = e.Graphics; Bitmap bmp = new Bitm. 阅读全文
posted @ 2012-03-14 20:06 ttssrs 阅读(225) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 下一页