打印和放大器;打印preVIEW在C#中的位图 [英] Print & Print Preview a Bitmap in c#

查看:223
本文介绍了打印和放大器;打印preVIEW在C#中的位图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了一个形象上借鉴了一个图片的程序,现在我想打印和打印preVIEW这一点,但不知道怎么办。请帮帮忙,

I have made a program that draws on a image on a picturebox and now i want to print and print preview this, but don't know how. Please Help,

感谢

修改
我一直在使用打印和打印preVIEW对话框尝试,但不知道如何正确地解决它们打印并显示一个图片的内容和图片

EDIT I have tried using print and print preview dialogs but don't know how to work them properly to print and show the contents of a picturebox and its image

推荐答案

放下你的窗体上的PrintDocument。你会想打印previewDialog和PrintDialog类为好。设置对话框文件属性为PrintDocument关联。实现PrintPage事件处理程序的话,可能是一个简单的:

Drop a PrintDocument on your form. You'll want a PrintPreviewDialog and PrintDialog as well. Set the dialogs' Document property to the PrintDocument. Implement the PrintPage event handler for it, could be a simple as:

    private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) {
        e.Graphics.DrawImage(pictureBox1.Image, 0, 0);
    }

和添加按钮或菜单项调用对话框的ShowDialog()方法。

And add buttons or menu items to call the dialogs' ShowDialog() method.

这篇关于打印和放大器;打印preVIEW在C#中的位图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆