hola ah todos saben tengo aca un duda quiero ingresar el ancho y el alto de la impresion mediante 2 TEXTBOX aca esta mi codgo solo quiero aumentar como hago para darle ancho y alto ah la impresion.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public OpenFileDialog ofdImagen = new OpenFileDialog();
public Form1()
{
InitializeComponent();
}
private void button2_Click(object sender, EventArgs e)
{
ofdImagen.Filter = "Ficheros BMP|*.bmp" +
"|Ficheros documento |*.doc" +
"|Ficheros JPG|*.jpg" +
"|Ficheros PNG |*.png" +
"|Ficheros EXIF|*.exif" +
"|Ficheros TIFF|*.tiff" +
"|Abrir Todos los Archivos|*.*";
pictureBox1.ImageLocation = (ofdImagen.ShowDialog() == DialogResult.OK) ? ofdImagen.FileName : null;
}
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
e.Graphics.DrawString("MI VISTA PREVIA", new Font(txttexto.Font.FontFamily, txttexto.SelectionFont.Size), Brushes.Black, 250, 50);
e.Graphics.DrawString(txttexto.Text, new Font(txttexto.Font.FontFamily, txttexto.SelectionFont.Size), Brushes.Black, 0, 100);
e.Graphics.DrawImage(pictureBox1.Image, 400, 100, 435, 435);
}
private void button1_Click(object sender, EventArgs e)
{
printDocument1.PrinterSettings = printDialog1.PrinterSettings;
printPreviewDialog1.Document = printDocument1;
printPreviewDialog1.ShowDialog();
}
}
}