Your Ad Here
首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 编程语言 > C/C++ > 一个用gdi+写的代码
【标  题】:一个用gdi+写的代码
【关键字】:gdi+
【来  源】:http://blog.csdn.net/jsxyhelu/archive/2007/01/20/1488758.aspx

一个用gdi+写的代码

Your Ad Here 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 WindowsApplication2


{



    public partial class Form1 : Form
    {


        protected override void OnPaint(PaintEventArgs e)
        {
            Brush linerbrush = new LinearGradientBrush(new Rectangle(10, 10, 59, 59), Color.Red , Color.White, 45);
            Graphics g = e.Graphics;
            g.FillRectangle(linerbrush, new Rectangle(10, 10, 590, 590));////作出来的效果那是一个棒!!
            linerbrush.Dispose();////这句那是相当的重要,我就忘了,机子就变得很慢了!
            Rectangle r1 = new Rectangle(10, 10, 59, 59);
            Region r = new Region(r1);////可以用这句把path或rectrangle等化为region,也可以用union加上一些东西。OK
            GraphicsPath path;
            path = new GraphicsPath(new Point[] { new Point(10, 10), new Point(150, 10), new Point(200, 150), new Point(10, 150), new Point(200, 160) },
                new byte[] { (byte)PathPointType.Start, (byte)PathPointType.Line, (byte)PathPointType.Line, (byte)PathPointType.Line, (byte)PathPointType.Line });
            //e.Graphics.DrawPath(Pens.Black, path);
            r.Union(path);
            //e.Graphics.FillRegion(Brushes.Black, r);////这句证明fillregion是用来画黑图的。
            //e.Graphics.DrawPath(Pens.Black, path);////这句证明了drawpath是用来画路径的 draw的都是path,而fill的都是region。

        }////为了能够重载,所以放在了这里。
  
  /// <summary>
  /// 只要是可以认真分析出来的图形,都可以画出来。
  /// </summary>
    
 
        public Form1()
        {
            InitializeComponent();



        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }
    }



}
KEIL C 使用总结大全!:【上一篇】
NET框架下使用双缓冲技术绘图:【下一篇】
【相关文章】
  • 基于Windows GDI+的几何线条处理
  • GDI+对象的释放
  • 用GDI+绘制了一个钟表盘的类似物,显示当前的时间
  • GDI+编程基础(一)GDI+ Vs GDI
  • GDI+编程(二)使用画笔
  • GDI+中的圆角矩形
  • DICK原创:Rendering an IHTMLElement to a Image File Using GDI+
  • GDI+简介
  • 利用.net(C#)在Vista磨砂玻璃窗口上正确画出文字和图片(GDI+版)
  • GDI+的BUG
  • 【随机文章】
  • AT指令
  • 简单的设置:解决Win XP系统网络访问难题
  • 操作数组的类
  • 硬件模仿秀:仿真虚拟软驱试用
  • Flash Remoting 跨域问题解决~
  • 学习如何使用打印服务API
  • 无线实时仓库管理系统 (ADO+ACCESS)
  • IPC$详细介绍
  • Microsoft Visual C++ 6.0 SP6 resource compiler buffer overflow
  • SmartCalendar 0.1 beta released!
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 bbb软讯网络 All Rigths Reserved.