PDA

View Full Version : مبتدی: مشكل پرينت



akhlaghi_mohammad
یک شنبه 25 مهر 1389, 15:15 عصر
آقا يكي كمك كنه...مشكل اين زير برنامه پرينت كيفيت بد پرينته...


[System.Runtime.InteropServices.DllImport("gdi32.dll")]
public static extern long BitBlt(IntPtr hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, IntPtr hdcSrc, int nXSrc, int nYSrc, int dwRop);
private Bitmap memoryImage;
private void CaptureScreen()
{
Graphics mygraphics = this.CreateGraphics();
Size s = this.Size;
memoryImage = new Bitmap(s.Width, s.Height, mygraphics);
Graphics memoryGraphics = Graphics.FromImage(memoryImage);
IntPtr dc1 = mygraphics.GetHdc();
IntPtr dc2 = memoryGraphics.GetHdc();
BitBlt(dc2, 0, 0, this.ClientRectangle.Width, this.ClientRectangle.Height, dc1, 0, 0, 13369376);
mygraphics.ReleaseHdc(dc1);
memoryGraphics.ReleaseHdc(dc2);
}
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
e.Graphics.DrawImage(memoryImage, 0, 0);
}

private void btnPrintFactor_Click(object sender, EventArgs e)
{
btnPrintFactor.Visible = false;
btnCancel.Visible = false;
CaptureScreen();
printDocument1.Print();
this.Close();
}

چيكار كنم كيفيتش بهتر شه...تو رو خدا كمك كنين؟؟؟