GDI+确实不行....弄了半天只想出了怎样画圆  , 至于那个像闪电的区域, 死活没想出来..等高手...
        private void Form1_Paint(object sender, PaintEventArgs e)
        {            Rectangle r = new Rectangle(10, 10, 100, 100); 
            e.Graphics.DrawEllipse(new Pen(Color.Red), r); 
            e.Graphics.FillEllipse(Brushes.Red, r);
        }
等高手.....

解决方案 »

  1.   

    PS..在事件最开始,再加上一句:
    e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias可以消除锯齿, 明显好多了....
      

  2.   

     private void Form1_Paint(object sender, PaintEventArgs e)
            {
                Graphics g = e.Graphics;
                PointF pO = new PointF(60, 50);//园左上焦点
                int c = 300;//园直径
                int plWidth = c / 3;
                float plWidthHalf = plWidth / 2.0f;
                GraphicsPath p = new GraphicsPath();//闪电路径
                GraphicsPath pH = new GraphicsPath();//闪电路径
                //设白闪电为头部朝下的霹雳
                PointF py = new PointF(pO.X + c / 2.0f, pO.Y);            PointF pgL0 = new PointF(py.X - plWidthHalf, pO.Y + 10);
                PointF pgR0 = new PointF(py.X + plWidthHalf, pO.Y + 10);            PointF pgL1 = new PointF(py.X - plWidthHalf * 0.8f - 6, pO.Y + c * 0.2f);
                PointF pgR1 = new PointF(py.X + plWidthHalf * 0.8f - 6, pO.Y + c * 0.2f);            PointF pgL2 = new PointF(py.X - plWidthHalf * 0.6f + 5, pO.Y + c * 0.4f);
                PointF pgR2 = new PointF(py.X + plWidthHalf * 0.6f + 5, pO.Y + c * 0.4f);            PointF pgL3 = new PointF(py.X - plWidthHalf * 0.4f - 4, pO.Y + c * 0.6f);
                PointF pgR3 = new PointF(py.X + plWidthHalf * 0.4f - 4, pO.Y + c * 0.6f);            PointF pgL4 = new PointF(py.X - plWidthHalf * 0.2f + 3, pO.Y + c * 0.8f);
                PointF pgR4 = new PointF(py.X + plWidthHalf * 0.2f + 3, pO.Y + c * 0.8f);
                PointF gt = new PointF(pO.X + c / 2.0f, pO.Y + c);            p.AddLine(pgL0, pgL1);
                p.AddLine(pgL1, pgL2);
                p.AddLine(pgL2, pgL3);
                p.AddLine(pgL3, pgL4);
                p.AddLine(pgL4, gt);
                p.AddLine(gt, pgR4);
                p.AddLine(pgR4, pgR3);
                p.AddLine(pgR3, pgR2);
                p.AddLine(pgR2, pgR1);
                p.AddLine(pgR1, pgR0);
                pH.AddPie(pO.X, pO.Y, c, c, -110, 40);            g.FillEllipse(Brushes.Red, pO.X, pO.Y, c, c);
                g.FillPath(Brushes.White, p);
                g.FillPath(Brushes.White, pH);        }
      

  3.   

    [size=24px]补充要求:
       将膏药旗撕开为两片,不是将膏药旗啃掉一块(绘制、填充一个圆,去掉中间一块)。[/
    size]
      

  4.   

    呵呵,做这个之前看看如果我们用phoneshop做会干啥事情1.先画圆,填充红色
    2。画中间的波浪线
    3。套索勾选左半边,然后自由形变,旋转一个角度
    4。勾选右半边半边,然后自由形变,旋转一个角度呵呵,明白过程了,用gdi+模拟这个过程就成
      

  5.   

       up
        期待 i n g 。 。 。
      

  6.   

    偶对GDI有天然的排斥,还好楼主这个图不难理解
      

  7.   

    支持个  但GDI+的东西不太熟
      

  8.   


    //放到Form的Paint事件中Graphics g=e.Graphics;
    g.SmoothingMode=SmoothingMode.HighQuality;
    g.TranslateTransform(300,300);
    g.RotateTransform(5f);
    Point[] ps=new Point[]{
      new Point(0,-100)
      ,new Point(-3,-92)
      ,new Point(2,-85)
      ,new Point(-5,-76)
      ,new Point(3,-65)
      ,new Point(-2,-57)
      ,new Point(4,-49)
      ,new Point(-3,-30)
      ,new Point(1,-13)
      ,new Point(-2,-9)
      ,new Point(0,0)
      };Point[] ps1=ps.ToArray<Point>();
    Rectangle rect=new Rectangle(-50,-100,100,100);
    GraphicsPath myPath=new GraphicsPath();myPath.StartFigure();
    Array.Reverse(ps);
    myPath.AddLines(ps);
    myPath.AddArc(rect,270,180);
    myPath.CloseFigure();
    g.DrawPath(new Pen(Color.Red,1),myPath);
    g.FillPath(new SoldBrush(Color.Red),myPath);myPath=new GraphicsPath();myPath.StartFigure();
    myPath.AddLines(ps1);
    myPath.AddArc(rect,90,180);
    myPath.CloseFigure();
    g.DrawPath(new Pen(Color.Red,1),myPath);
    g.FillPath(new SoldBrush(Color.Red),myPath);
    撕开的形状和楼主的不太一样,这个需要慢慢的调
      

  9.   

    GDI会一点点,但是实现不出来那效果,期待高手。
      

  10.   

    更正一下,
    在myPath=new GraphicsPath();
    上面增加一句 g.RotateTransform( -10f );
    完整代码如下:        private void Form1_Paint( object sender, PaintEventArgs e )
            {
                Graphics g = e.Graphics;
                g.SmoothingMode = SmoothingMode.HighQuality;
                g.TranslateTransform( 300, 300 );
                g.RotateTransform( 5f );
                Point[] ps = new Point[]{
                      new Point(0,-100)
                      ,new Point(-3,-92)
                      ,new Point(2,-85)
                      ,new Point(-5,-76)
                      ,new Point(3,-65)
                      ,new Point(-2,-57)
                      ,new Point(4,-49)
                      ,new Point(-3,-30)
                      ,new Point(1,-13)
                      ,new Point(-2,-9)
                      ,new Point(0,0)
                      };            Point[] ps1 = ps.ToArray<Point>();
                Rectangle rect = new Rectangle( -50, -100, 100, 100 );
                GraphicsPath myPath = new GraphicsPath();            myPath.StartFigure();
                Array.Reverse( ps );
                myPath.AddLines( ps );
                myPath.AddArc( rect, 270, 180 );
                myPath.CloseFigure();
                g.DrawPath( new Pen( Color.Red, 1 ), myPath );
                g.FillPath( new SolidBrush( Color.Yellow ), myPath );
                g.RotateTransform( -10f );
                myPath = new GraphicsPath();            myPath.StartFigure();
                myPath.AddLines( ps1 );
                myPath.AddArc( rect, 90, 180 );
                myPath.CloseFigure();
                g.DrawPath( new Pen( Color.Red, 1 ), myPath );
                g.FillPath( new SolidBrush( Color.Green ), myPath );
            }
    测试环境:
    WinXP(SP2)、VS2008(SP1)、Framework3.5(SP1)
      

  11.   

    using Microsoft.VisualBasic;
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing.Imaging;
    public class Form1
    {
    Bitmap BP_0;
    /// <summary>
    /// 太阳半径
    /// </summary>
    /// <res></res>
    private int SunRadio = 150;
    /// <summary>
    /// 裂口段数
    /// </summary>
    /// <res></res>
    private int LightStb = 8; private void Form1_Load(System.Object sender, System.EventArgs e)
    {
    } private void Form1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
    {
    PointF[] Pts = new PointF[LightStb + 2];
    using (Bitmap B1 = new Bitmap(SunRadio, SunRadio)) {
    using (Graphics G = Graphics.FromImage(B1)) {
    G.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias;
    Pts(0) = new Point(SunRadio / 2, 0);
    Pts(9) = new Point(SunRadio / 2, SunRadio);
    for (int I = 1; I <= LightStb; I++) {
    if (I % 2 != 0) {
    Pts(I) = new Point(SunRadio / 2 - 50 / I / 2, SunRadio / 8 * I);
    } else {
    Pts(I) = new Point(SunRadio / 2 + 50 / I / 2, SunRadio / 8 * I);
    }
    }
    using (Drawing2D.GraphicsPath Gp = new Drawing2D.GraphicsPath()) {
    Gp.AddLines(Pts);
    Gp.AddArc(new Rectangle(0, 0, SunRadio, SunRadio), 90, 180);
    G.FillPath(Brushes.Red, Gp);
    }
    }
    using (Bitmap B2 = new Bitmap(SunRadio, SunRadio)) {
    using (Drawing2D.GraphicsPath Gp = new Drawing2D.GraphicsPath()) {
    Gp.AddLines(Pts);
    Gp.AddArc(new Rectangle(0, 0, SunRadio, SunRadio), -90, 180);
    using (Graphics G = Graphics.FromImage(B2)) {
    G.FillPath(Brushes.Red, Gp);
    }
    }
    using (Bitmap B3 = new Bitmap(SunRadio, SunRadio)) {
    using (Bitmap B4 = new Bitmap(SunRadio, SunRadio)) {
    using (Graphics G = Graphics.FromImage(B3)) {
    G.TranslateTransform(SunRadio / 2, SunRadio / 2);
    G.RotateTransform(-5);
    G.DrawImage(B1, new Rectangle(-SunRadio / 2, -SunRadio / 2, SunRadio, SunRadio), new Rectangle(0, 0, SunRadio, SunRadio), GraphicsUnit.Pixel);
    }
    using (Graphics G = Graphics.FromImage(B4)) {
    G.TranslateTransform(SunRadio / 2, SunRadio / 2);
    G.RotateTransform(5);
    G.DrawImage(B2, new Rectangle(-SunRadio / 2, -SunRadio / 2, SunRadio, SunRadio), new Rectangle(0, 0, SunRadio, SunRadio), GraphicsUnit.Pixel);
    }
    if (BP_0 != null)
    BP_0.Dispose();
    BP_0 = new Bitmap(SunRadio + 30, SunRadio);
    using (Graphics G = Graphics.FromImage(BP_0)) {
    G.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias;
    G.DrawImage(B3, new Point(0, 0));
    G.DrawImage(B4, new Point(15, 0));
    this.BackgroundImageLayout = ImageLayout.Center;
    this.BackgroundImage = BP_0;
    }
    }
    }
    }
    }
    }
    public Form1()
    {
    MouseDown += Form1_MouseDown;
    Load += Form1_Load;
    }
    }
      

  12.   

    http://www.dylike-soft.com/temp/japan.jpg
      

  13.   

    dylike实在强!这个帖子要顶!
      

  14.   

    贴下实现代码:private void Form1_Shown(object sender, EventArgs e)
            {
                Graphics g = this.CreateGraphics();
                g.SmoothingMode = SmoothingMode.AntiAlias;
                g.FillEllipse(Brushes.Red, new Rectangle(80, 70, 120, 120));
                
                GraphicsPath gpth = new GraphicsPath();
                Point[] pt = new Point[] 
                {new Point(130, 70), new Point(130, 110), new Point(130, 130), new Point(140, 150), new Point(135, 160), new Point(140, 170) ,new Point(135, 188),
                 new Point(140, 188), new Point(143, 190), new Point(144, 188), new Point(140, 180), new Point(145, 170), new Point(140, 160), new Point(144, 150),
                new Point(137, 129), new Point(145, 120), new Point(142, 108), new Point(150, 70)};
                gpth.AddLines(pt);
                g.FillPath(Brushes.White, gpth);
            }