救命!我的异形窗体,轮廓不清晰,周围有毛边!

解决方案 »

  1.   

    不好意思我打不开附件,如果你的这个窗体是根据图片用onpaint方法重载画出来的画的话,可能是图片的制作不好,精度不好,或者是画笔参数,让画笔大了点,
      

  2.   

    是不是设置了窗体的透明颜色,然后把图片要搂空的地方填充为窗体的颜色。
    这样会有毛边的,特别是图片的沿边是用了渐变(A<255)的。
      

  3.   

     Graphics 的这个属性的意思,你看看。
     SmoothingMode 属性 
    平滑模式指定直线、曲线和已填充区域的边缘是否采用平滑处理(又称锯齿消除功能)。private void ShowPensAndSmoothingMode(PaintEventArgs e)
    {    // Set the SmoothingMode property to smooth the line.
        e.Graphics.SmoothingMode = 
            System.Drawing.Drawing2D.SmoothingMode.AntiAlias;    // Create a new Pen object.
        Pen greenPen = new Pen(Color.Green);    // Set the width to 6.
        greenPen.Width = 6.0F;    // Set the DashCap to round.
        greenPen.DashCap = System.Drawing.Drawing2D.DashCap.Round;    // Create a custom dash pattern.
        greenPen.DashPattern = new float[]{4.0F, 2.0F, 1.0F, 3.0F};    // Draw a line.
        e.Graphics.DrawLine(greenPen, 20.0F, 20.0F, 100.0F, 240.0F);    // Change the SmoothingMode to none.
        e.Graphics.SmoothingMode = 
            System.Drawing.Drawing2D.SmoothingMode.None;    // Draw another line.
        e.Graphics.DrawLine(greenPen, 100.0F, 240.0F, 160.0F, 20.0F);    // Dispose of the custom pen.
        greenPen.Dispose();
    }
    //MSDN上的代码,希望对楼主有帮助。