I am using WinForms. My program opens. Sample images in a text file. The problem I am facing is printing high quality TIFF images from an image. I have checked and tested prints many times. When a document prints words, they are not clear / transparent, they are a bit blurry. I also checked my printer to see if there is a problem with my printer. I printed a plain text document using the word Microsoft and it printed clearly, so its a problem with my code.
Can someone provide me with code for printing in high quality .tiff images in my picture? Do I need to increase my DPI programmatically to improve image quality?

This is my code.
private void DVPrintDocument_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
e.Graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
e.Graphics.DrawImage(pictureBox1.Image, 25, 25, 800, 1050);
}
private void Print_button_Click(object sender, EventArgs e)
{
PrintPreviewDialog.Document = PrintDocument;
PrintPreviewDialog.ShowDialog();
}
, , , . Tiff, tiff. RefreshImage , .
:
private int intCurrPage = 0;
bool opened = false;
private void btn_Back_Click(object sender, EventArgs e)
{
if (opened)
{
if (intCurrPage == 0)
{ intCurrPage = 0; }
else
{
intCurrPage--;
RefreshImage();
}
}
}
private void btn_Next_Click(object sender, EventArgs e)
{
if (opened)
{
if (intCurrPage == Convert.ToInt32(lblNumPages.Text))
{ intCurrPage = Convert.ToInt32(lblNumPages.Text); }
else
{
intCurrPage++;
RefreshImage();
}
}
}
private void Form1_Load(object sender, EventArgs e)
{
var bm = new Bitmap(pictureBox1.Image);
bm.SetResolution(600, 600);
Image image1 = new Bitmap(bm);
pictureBox1.Image = image1;
pictureBox1.Refresh();
}
public void RefreshImage()
{
Image myImg;
Image myBmp;
myImg = System.Drawing.Image.FromFile(@lblFile.Text);
int intPages = myImg.GetFrameCount(System.Drawing.Imaging.FrameDimension.Page);
intPages--;
lblNumPages.Text = Convert.ToString(intPages);
lblCurrPage.Text = Convert.ToString(intCurrPage);
myImg.SelectActiveFrame(System.Drawing.Imaging.FrameDimension.Page, intCurrPage);
myBmp = new Bitmap(myImg, pictureBox1.Width, pictureBox1.Height);
pictureBox1.Image = myBmp;
}
