GDI+绘图不明晰

GDI+绘图不清晰
GDI+绘图不明晰
(这是在报表中显示的截图,如何才能做到图右边显示的内容和左边一样清晰)
在窗体的picturebox中画图,然后
MemoryStream msCurve = new MemoryStream();
this.curvePictureBox1.Image.Save(msCurve, System.Drawing.Imaging.ImageFormat.Jpeg);
并把这个msCurve送到报表中去。

报表是自带的rdlc报表。
picturebox的大小与报表中图片的大小一致。

绘图时已经做了
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit;

如何才能把分辨率提高到300?
------解决思路----------------------
解决方案1
传送到报表的时候,gdi以高分辨率重绘.
解决方案2:
gdi绘制后以矢量图形格式输出,C#完全支持,以前我就是这么做的,效果非常好.
但要看你的报表控件是否支持矢量图形.
------解决思路----------------------
emf矢量图形绘制,我以前的代码,仅供参考



  /// <summary>
        /// 绘制矢量图形,保存到指定位置
        /// <para>Log-Log</para>
        /// </summary>
        /// <param name="width"></param>
        /// <param name="height"></param>
        /// <param name="rlu"></param>
        /// <param name="cv"></param>
        /// <returns></returns>
        private Bitmap DrawBmg2(int width, int height, double[] rlu, double[] cv)
        {
            //Bitmap bmp = new Bitmap(width, height);
            Bitmap bmp = new Bitmap(width, height);
            Graphics gs = Graphics.FromImage(bmp);
            Metafile mf = new Metafile("C:\\aa.emf", gs.GetHdc());
            Graphics gc = Graphics.FromImage(mf);
            int Hpace = 20;//坐标图距离底部的距离
            int Wpace = 20;//距离左侧的距离
            double dbxMaxCv = Math.Log10(cv[5]);
            double dbxMinCv = Math.Log10(cv[1]);
            double minY = Convert.ToDouble(((Math.Round(dbxMaxCv, 1) - Math.Round(dbxMinCv, 1)) / 4).ToString("f1"));
            minY = (minY * 4 + minY) / 4;


            //  Graphics gc = Graphics.FromImage(bmp);
            Rectangle rect = new Rectangle(0, 0, width, height);
            gc.FillRectangle(Brushes.White, rect);

            Pen penRed = new Pen(Brushes.Red, 1);
            Pen penBlack = new Pen(Brushes.Black, 1);

            //x轴直线以及箭头
            gc.DrawLine(penBlack, new Point(Wpace, height - Hpace), new Point(width - Wpace + 10, height - Hpace));
            gc.DrawLine(penBlack, new Point(width - Wpace + 10, height - Hpace), new Point(width - Wpace + 10 - 5, height - Hpace + 5));
            gc.DrawLine(penBlack, new Point(width - Wpace + 10, height - Hpace), new Point(width - Wpace + 10 - 5, height - Hpace - 5));
            //y轴直线
            gc.DrawLine(penBlack, new Point(Wpace, height - Hpace), new Point(Wpace, Hpace - 10));
            gc.DrawLine(penBlack, new Point(Wpace, Wpace - 10), new Point(Wpace - 5, Hpace + 5 - 10));
            gc.DrawLine(penBlack, new Point(Wpace, Wpace - 10), new Point(Wpace + 5, Hpace + 5 - 10));

            int pxW = (width - Wpace * 2) / (rlu.Length - 1);//
            int pxH = (height - Hpace * 2) / (cv.Length - 1);
            //   MessageBox.Show("pxW:" + pxW.ToString() + "\r\npxH:" + pxH.ToString());
            //绘制坐标点
            for (int i = 1; i < rlu.Length; i++)
            {
                //x
                gc.DrawLine(penBlack, new Point(Wpace + pxW * i, height - Hpace), new Point(Wpace + pxW * i, height - Hpace + 3));

                //y
                gc.DrawLine(penBlack, new Point(Wpace, height - Wpace - pxH * i), new Point(Wpace - 3, height - Wpace - pxH * i));


                /**
                 * 需要四舍五入优化
                 * */
                gc.DrawString(cv[i].ToString("f2"), new Font("Arial", 9), Brushes.Black, new Point(Wpace + pxW * i - 10, height - Hpace + 2));
                gc.DrawString(rlu[i].ToString("f2"), new Font("Arial", 9), Brushes.Black, new Point(Wpace - 15, height - Wpace - pxH * i - 5));
            }

            //0点位置wpace,height-hpace
            int pointRadius = 4;//必须为偶数

            double xPointValue = (cv[5] - cv[0]) / (width - Wpace * 2);//一个像素对应的值
            double yPointValue = (rlu[5] - rlu[0]) / (height - Hpace * 2);
            for (int i = 1; i < rlu.Length; i++)
            {
                //  Rectangle rectPoint = new Rectangle(new Point(Wpace - pointRadius / 2, height - Hpace - pointRadius / 2), new Size(pointRadius, pointRadius));
                Rectangle rectPoint = new Rectangle(new Point(Wpace + Convert.ToInt32((cv[i] - cv[0]) / (xPointValue)) - pointRadius / 2, height - Convert.ToInt32((rlu[i] - rlu[0]) / (yPointValue)) - Hpace - pointRadius / 2), new Size(pointRadius, pointRadius));
                gc.DrawEllipse(penRed, rectPoint);
                gc.FillEllipse(Brushes.Red, rectPoint);
                //if (i < rlu.Length - 1)
                //{
                //    gc.DrawLine(penRed, new Point(Wpace + Convert.ToInt32((cv[i] - cv[0]) / (xPointValue)) - pointRadius / 2, height - Convert.ToInt32((rlu[i] - rlu[0]) / (yPointValue)) - Hpace),
                //        new Point(Wpace + Convert.ToInt32((cv[i + 1] - cv[0]) / (xPointValue)) - pointRadius / 2, height - Convert.ToInt32((rlu[i + 1] - rlu[0]) / (yPointValue)) - Hpace));
                //}
            }
            gc.DrawLine(penRed, new Point(Wpace + Convert.ToInt32((cv[1] - cv[0]) / (xPointValue)) - pointRadius / 2, height - Convert.ToInt32((rlu[1] - rlu[0]) / (yPointValue)) - Hpace),
                       new Point(Wpace + Convert.ToInt32((cv[5] - cv[0]) / (xPointValue)) - pointRadius / 2, height - Convert.ToInt32((rlu[5] - rlu[0]) / (yPointValue)) - Hpace));

            gs.Dispose();
            mf.Dispose();
            gc.Dispose();

            return bmp;
        }



中间的是绘制点线图的代码,直接忽略.