使用Windows打印图像对话框打印图像 [英] Print image using windows print image dialog

查看:161
本文介绍了使用Windows打印图像对话框打印图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道如何使用PrintDocument打印图像。但是,我想使用默认的Windows打印功能打印我的图像。就像右键单击图像并单击打印一样,会出现一个对话框,允许您设置大小选择打印机等。有人知道如何在C#中实现这一点吗?我必须使用WINAPI吗?

I know how to print an image using PrintDocument. However, i want to print my Image using the default windows print function. Like when you right click an image and click print, the dialog comes up that allows you to set size choose printer etc. Does anyone know how to achieve this in C#? Do i have to use WINAPI ?

干杯

编辑:

我在谈论这个打印对话框。

I'm talking about this print dialog.

推荐答案

您可以使用Process类启动该对话框。

You can launch that dialog with the Process class.

    private void button1_Click(object sender, EventArgs e)
    {
        string fileName = @"C:\Development\myImage.tif";//pass in or whatever you need
        var p = new Process();
        p.StartInfo.FileName = fileName;
        p.StartInfo.Verb = "Print";
        p.Start();
    }

这篇关于使用Windows打印图像对话框打印图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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