elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Recuerda que debes registrarte en el foro para poder participar (preguntar y responder)


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  .NET (C#, VB.NET, ASP) (Moderador: kub0x)
| | | |-+  impresion
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: impresion  (Leído 2,255 veces)
Choclito

Desconectado Desconectado

Mensajes: 99



Ver Perfil
impresion
« en: 7 Noviembre 2009, 00:36 am »

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();           
        }
    }
}


En línea

MANULOMM


Desconectado Desconectado

Mensajes: 559


Erepublik.com


Ver Perfil
Re: impresion
« Respuesta #1 en: 9 Noviembre 2009, 17:56 pm »

te refieres por ancho a:
la imagen seria aka.
Código
  1. e.Graphics.DrawImage(pictureBox1.Image, 400, 100, 435, 435);
  2.  
uno de esos parametros es.

si es a la hoja seria aqui.
Código
  1. printDocument1.PrinterSettings = printDialog1.PrinterSettings;
  2.  
modifica los printersettings alli le pasas ancho y alto de la hoja personalizada.

Atentamente,

Juan Manuel Lombana
Medellín - Colombia


En línea


Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
[Duda] Impresion stdprn « 1 2 »
Programación C/C++
apoeti 10 5,786 Último mensaje 6 Septiembre 2012, 14:26 pm
por apoeti
La impresión en 3D se comercializará en Europa el año que viene
Noticias
wolfbcn 0 1,163 Último mensaje 29 Noviembre 2012, 19:06 pm
por wolfbcn
Impresión de archivo HLP
Foro Libre
donottrustno01 2 1,833 Último mensaje 16 Diciembre 2012, 16:00 pm
por donottrustno01
problemas de impresion
Software
novato28 0 987 Último mensaje 28 Febrero 2013, 16:26 pm
por novato28
El futuro de la impresión 3D son los objetos 4D
Noticias
wolfbcn 0 1,579 Último mensaje 3 Marzo 2013, 23:18 pm
por wolfbcn
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines