本文介绍了我如何将picture_Box中的图像保存为.pdf文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用此代码扫描扫描仪中的图像:

***************************** ************************

尝试

RasterCodecs.Startup()



Me.TwainSession = New TwainSession



Me.TwainSession.Startup(Me,Scan Technologies,Inc。, Abdulla Scanner .NET,版本16,Abdulla Twain测试样本,TwainStartupFlags.None)

Me.TwainSession.ShowProgressIndicator(True)



Me.Text = TwainSession.SelectedSourceName



Catch ex As Exception

MsgBox(ex.Message,MsgBoxStyle.Exclamation, 错误)

结束尝试



*********

Private Sub TwainSession_AcquirePage (ByVal sender As Object,ByVal e As Leadtools.Twain.TwainAcquirePageEventArgs)处理TwainSession.AcquirePage

尝试

如果Not IsNothing(e.Image)然后

PictureBox1.Image = Image.FromHbitmap(e.Image.ToHBitmap)

结束如果

Catch ex As Exception

MessageBox.Show(ex.Message,خطأ,MessageBoxButtons.OK,MessageBoxIcon.Error)

结束尝试

结束子

*************

Private Sub Button1_Click(ByVal sender As System.Object,ByVal e As System.EventArgs)处理Button1.Click



尝试

Me.TwainSession.Acquire(TwainUserInterfaceFlags.Show)

'------------ ----------------------------

Catch ex As Exception

MsgBox( ex.Message.ToString,MsgBoxStyle.Critical或MsgBoxStyle.MsgBoxRight + MsgBoxStyle.MsgBoxRtlReading,scan)

结束尝试



End Sub



*************** __________________________________________________



I尝试使用此代码,但它不起作用???

PictureBox1.Image.Save(C:&\ Img100.pdf,Imaging.ImageFormat.pdf)



你能帮我吗?

I use this code to scan image from scanner :
*****************************************************
Try
RasterCodecs.Startup()

Me.TwainSession = New TwainSession

Me.TwainSession.Startup(Me, "Scan Technologies, Inc.", "Abdulla Scanner .NET", "Version 16", "Abdulla Twain test sample", TwainStartupFlags.None)
Me.TwainSession.ShowProgressIndicator(True)

Me.Text = TwainSession.SelectedSourceName

Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Exclamation, "error")
End Try

*********
Private Sub TwainSession_AcquirePage(ByVal sender As Object, ByVal e As Leadtools.Twain.TwainAcquirePageEventArgs) Handles TwainSession.AcquirePage
Try
If Not IsNothing(e.Image) Then
PictureBox1.Image = Image.FromHbitmap(e.Image.ToHBitmap)
End If
Catch ex As Exception
MessageBox.Show(ex.Message, "خطأ", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
*************
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Try
Me.TwainSession.Acquire(TwainUserInterfaceFlags.Show)
'----------------------------------------
Catch ex As Exception
MsgBox(ex.Message.ToString, MsgBoxStyle.Critical Or MsgBoxStyle.MsgBoxRight + MsgBoxStyle.MsgBoxRtlReading, "scan")
End Try

End Sub

***************__________________________________________________

I try to use this code but it is not working???
PictureBox1.Image.Save("C:" & "\Img100.pdf", Imaging.ImageFormat.pdf)

can you help me?

推荐答案



这篇关于我如何将picture_Box中的图像保存为.pdf文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 04:15