如何在WPF VB中打印图像 [英] How to print image in WPF VB

查看:76
本文介绍了如何在WPF VB中打印图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用WPF和VB在我的电脑上打印图像



i want to print an image on my computer using WPF and VB

Private Sub btnPrint_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles btnPrint.Click
        Dim Pd As New PrintDialog
        Dim vis As New DrawingVisual
        Dim drc As DrawingContext
        Dim img As System.Windows.Media.ImageSource
        Dim img1 As BitmapImage

        img1 = New BitmapImage(New Uri("C:\Windows\Temp\c.jpeg"))
        img = img1
        drc = vis.RenderOpen()
        drc.DrawImage(img1, New Rect(New Size(img1.Width, img1.Height)))
        If Pd.ShowDialog = True Then
            Pd.PrintVisual(vis, "fdfd")
        End If

    End Sub





我尝试过:



i已经尝试过使用



What I have tried:

i have already tried using

printdialoge

方法

推荐答案

参见 print image vb.net - Google搜索 [ ^ ]。


见这里:在WPF中打印 [ ^ ] - 代码示例在C#中,但是在线转换器和一点思考应该可以帮助您:代码转换器C#到VB和VB到C# - Telerik [ ^ ]
See here: Printing in WPF[^] - the code examples are in C# but online converters and a little thinking should get you there: Code Converter C# to VB and VB to C# – Telerik[^]

这篇关于如何在WPF VB中打印图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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