PDA

View Full Version : سوال: landscape کردن با کد



sinaprog
یک شنبه 18 اردیبهشت 1390, 20:44 عصر
سلام
من این کدا رو نوشتمvoid PrintImage(object o, PrintPageEventArgs e)
{
int x = SystemInformation.WorkingArea.X;
int y = SystemInformation.WorkingArea.Y;
int width = this.Width;
int height = this.Height;
Rectangle bounds = new Rectangle(x, y, width, height);
Bitmap img = new Bitmap(width, height);
this.DrawToBitmap(img, bounds);
Point p = new Point(100, 100);
e.Graphics.DrawImage(img, p);
}

بعدشم
private void button4_Click(object sender, EventArgs e)
{
PrintDocument pd = new PrintDocument();
pd.PrintPage += new PrintPageEventHandler(PrintImage);
printDialog1.ShowDialog();
printPreviewDialog1.Document = pd;
printPreviewDialog1.ShowDialog();
//pd.Print();
}
حالا باید کجاlandscapesh لطفاکامل توضیح بدین