图片zoom后是否失真,不是由程序可以控制的
我看,楼主还是死了这条心吧

解决方案 »

  1.   

    晕,先不管失真了.
    我选定一个区域上色.为什么不能自动显示,必须我用鼠标点了左上部和右下部才显示出图形.
    鼠标带的TOOLTIP为什么可以擦除掉我刚画的图形.
    代码如下
    private void stnDrawEllipse(Point p,int iOver)
    {
    Color ccolor=System.Drawing.Color.Red;
    System.Drawing.Pen myPen ;
    System.Drawing.Graphics formGraphics = this.picMap.CreateGraphics();
    for(int i=0;i<System.Math.Abs(iOver);i++)
    {
    int m=(int)(i/255);
    if (m==0)
    {ccolor=System.Drawing.Color.FromArgb(255-i,0,0);}
    else 
    {ccolor=System.Drawing.Color.FromArgb(i-255*m,0,0);}
    myPen = new System.Drawing.Pen(ccolor);
    formGraphics.DrawEllipse(myPen, new Rectangle(p.X,p.Y,i,i));
    myPen.Dispose();
    }

    formGraphics.Dispose();
    }
     Reeezak(坚持信念) 帮忙看看啊.谢
      

  2.   

    graphics.Drawimage本身就有可以控制输出大小的OVERLOAD,用这个就可以实现放大缩小。System.Drawing.Graphics g=this.CreateGraphics();
    System.Drawing.Image img=this.Icon.ToBitmap();
    g.DrawImage(img, new RectangleF(0,0,img.Width <<1 , img.Height <<1), new RectangleF(0,0, img.Width, img.Height ), System.Drawing.GraphicsUnit.Pixel );你的代码出现的问题是正常的,你可以将图象画在IMAGE中或建立一个重画机制(在OnPaint中重画)就能解决,例如:
    protected override void OnPaint(PaintEventArgs e)
    {
    base.OnPaint (e);
    this.stnDrawEllipse(...);
    }
      

  3.   

    谢谢Brunhild() ,我先照你的方法试.
      

  4.   

    请问如何避免TOOLTIP擦除掉我刚画的图形.