Click here to Skip to main content
15,896,111 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
private void pictureBox1_Paint(object sender, PaintEventArgs e)
        {
            
            Font font = new Font("Arial", 8, FontStyle.Regular);
            //e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
            //e.Graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
            e.Graphics.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality;
           // e.SmoothingMode = SmoothingMode.AntiAlias;
           // e.InterpolationMode = InterpolationMode.HighQualityBicubic;
            //e.PixelOffsetMode = PixelOffsetMode.HighQuality;
                e.Graphics.DrawString("FIRST NAME" , myFont, Brushes.Black, 15, 90);
                e.Graphics.DrawString("MIDDLE NAME", font, Brushes.Black, 15, 105);
                e.Graphics.DrawString("LASTNAME", font, Brushes.Black, 15, 120);
                e.Graphics.DrawString("ADDRESS", font, Brushes.Black, 15, 135);
          e.Graphics.Flush();
          }
 private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
        {
            float x = 0;
            float y = 0;
            //SolidBrush myBrush = new SolidBrush(Color.Black);
            e.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
            e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
            e.Graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
            e.Graphics.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality;           
            Bitmap bmp = new Bitmap(this.pictureBox1.Width, this.pictureBox1.Height);
            this.pictureBox1.DrawToBitmap(bmp, new Rectangle(0, 0, this.pictureBox1.Width, this.pictureBox1.Height));
            e.Graphics.DrawImage((Image)bmp, x, y);
        }


print font word are not clear visible when i print picturebox image. i want clear font (like microsoft word or excel print) letters visible when i printing images. means good pixels anybody suggest me?
Posted
Updated 20-Nov-14 0:44am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900