C#图形编程

  • c# 图形移动与旋转
    摘要: 1 、旋转e.Graphics.RotateTransform(30.0F, MatrixOrder.Prepend);2、平移e.Graphics.TranslateTransform(100.0F, 0.0F);3、缩放e.Graphics.ScaleTransform(3.0F, 1.0F, MatrixOrder.Append);4、点坐标变换 e.Graphics.TranslateTr... 阅读全文
    posted @  2009-05-18 14:49 阿朵 阅读(1319) |  评论 (0)  编辑
  • C# 设置绘图区的显示区域SetClip
    摘要: graphics.Isvisible(点、区域) :这些点,区域是否在绘图板的可见范围。设置显示区域主要代码:graphics.SetClip(范围,显示模式)graphics.IntersetClip(用来相交的范围);//设置新范围为老范围和此输入范围的交集。graphics.ResetClip();//重置[代码]范围可以为:1、指定区域graphics1.SetClip(new Recta... 阅读全文
    posted @  2009-05-18 13:58 阿朵 阅读(970) |  评论 (0)  编辑
  • C# 截屏
    摘要: 绘制当前屏幕e.Graphics.CopyFromScreen(new Point(10,10)截屏起点, new Point(140, 140)绘制起点, new Size(100,100)截取大小, CopyPixelOperation.MergeCopy显示模式); 特殊的参数:当前窗口位置:this.Location全屏大小:Screen.GetWorkingArea(this).Size... 阅读全文
    posted @  2009-05-18 13:06 阿朵 阅读(509) |  评论 (0)  编辑
  • C# 画图中类似于建模的参考坐标系功能
    摘要: 在实体建模软件中,经常有设置并保存各种参考坐标系的功能,方便建立模型。C#绘图中也有这种类似功能。不过没有建模软件那么强大。实体建模软件中,可以独立的设置并保存各种坐标系,并随时调用。而这里只能以嵌套的形式调用,当返回到上一级状态时,跳过的状态就不再保存了。1 普通模式主要命令:state = graphics.BeginContainer();建一个新绘图状态 e.Graphics.EndCon... 阅读全文
    posted @  2009-05-18 10:49 阿朵 阅读(883) |  评论 (0)  编辑
  • C# 图形绘制——指定线条端部形状
    摘要: 1 使用预定义形状 画笔属性pen.StartCap和pen.EndCap指定线条的两端形状。 预定义的形状:LineCap.Round 、LineCap.ArrowAnchor等等如: pen.StartCap = LineCap.Round; 2 使用自定义形状 如果使用自定义的端部形状,则使用pen.CustomStartCap和pen.CustomEndCap属性 CustomLineCa... 阅读全文
    posted @  2009-05-15 17:01 阿朵 阅读(536) |  评论 (1)  编辑
  • C# 绘制基本图形单元命令汇总
    摘要: 1 定义画板Graphics g = paintEvnt.Graphics;//绘制事件的 画板成员Graphics g = this.CreateGraphics();//或者直接生成。this可以为Form1,pictureBoxGraphicsg = Graphics.FromHwnd(hwnd);//从窗口句柄生成。其中:IntPtr hwnd = this.Handle;Graphics... 阅读全文
    posted @  2009-05-15 16:02 阿朵 阅读(675) |  评论 (0)  编辑
  • C# 图像操作1
    摘要: 1 显示图片主要命令:Image.FromFile();graphics.DrawImage(image);[代码]2 图像缩略图主要命令:image.GetThumbnailImage();[代码]3 创建图片文件主要命令:Metafile("filename",hdc)。IntPtr hdc = graphics.GetHdc();graphics2 = Graphics.FromImage(... 阅读全文
    posted @  2009-05-15 12:57 阿朵 阅读(1099) |  评论 (0)  编辑
  • C# 画图(1)
    摘要: protected override void OnPaint(PaintEventArgs paintEvnt) { //获取画板 Graphics gfx = paintEvnt.Graphics; // 构造画笔 Pen myPen = new Pen(Color.Black); // 画线 for (int i = 20; i < 250; i = i + 10) { gfx.Dr... 阅读全文
    posted @  2009-05-15 12:53 阿朵 阅读(2842) |  评论 (1)  编辑
This Wrox Blox teaches you how to add graphics to C# 2008 applications, explaining fundamental graphics techniques such as: drawing shapes with different colors and line styles; filling areas with colors, gradients, and patterns; drawing text that is properly aligned, sized, and clipped exactly where you want it; manipulating images and saving results in bitmap, JPEG, and other types of files. Also covered are instructions for how to greatly increase your graphics capabilities using transformations. Transformations allow you to move, stretch, or rotate graphics. They also let you work in coordinate systems that make sense for your application. You will also learn how to use all of these techniques in printouts. The author describes the sequence of events that produce a printout and shows how to generate and preview printouts. The final sections describe two powerful new graphic tools that were introduced with .NET Framework 3.0: WPF graphics and FlowDocuments. WPF applications can use XAML graphic commands to declaratively draw and fill the same kinds of shapes that a program can draw by using graphics objects. Finally, a discussion on the FlowDocument object shows you how to define items that should be flowed across multiple pages as space permits. This lets you display text, graphics, controls, and other items that automatically flow across page breaks. FlowDocument viewers make displaying these documents easy for you, and simplifies the user's reading of the documents. This Wrox Blox also contains 35 example programs written in C# 2008, although most of the code works in previous versions of C# as well. The most notable exceptions are WPF graphics and FlowDocuments, both of which require WPF provided in .NET Framework 3.0 and later.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值