private void printD_PrintPage(object sender, PrintPageEventArgs e)
{
Bitmap memoryimg;
Panel p = BillBody;
Graphics g = p.CreateGraphics();
memoryimg = new Bitmap(p.Width, p.Height);
p.DrawToBitmap(memoryimg, new Rectangle(0, 0, p.Width, p.Height));
Rectangle rec = e.PageBounds;
e.Graphics.DrawImage(memoryimg, (rec.Width / 2) - (BillBody.Width / 2), 10);
}
My Result here
even I used code SetResolution(float xDpi, float yDpi)
Method like this
private void printD_PrintPage(object sender, PrintPageEventArgs e)
{
Bitmap memoryimg;
Panel p = BillBody;
Graphics g = p.CreateGraphics();
memoryimg = new Bitmap(p.Width, p.Height,g);
memoryimg.SetResolution(600, 600);
p.DrawToBitmap(memoryimg, new Rectangle(0, 0, p.Width, p.Height));
Rectangle rec = e.PageBounds;
e.Graphics.DrawImage(memoryimg, (rec.Width / 2) - (BillBody.Width / 2), 10);
}
But this time this Happen See Here Can Anyone Help me