Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Wednesday, July 18, 2007 1:04:26 AM(UTC)

Zouhair  
Zouhair

Groups: Registered
Posts: 3


hi,

i wloud like if it possible to print string when i scaning the page,  give me if it possible the example.

thanks

i use dotnet and leadtools 14.5

my function begin by:

twnSession = new TwainSession();

twnSession.Startup(this, "LEAD Technologies, Inc.", "LEAD Test Applications", "Version 1.0", "TWAIN ");

twnSession.AcquirePage += new TwainAcquirePageEventHandler(twainSession_AcquirePage);

 

 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Wednesday, July 18, 2007 10:43:11 PM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,328

Was thanked: 1 time(s) in 1 post(s)

Hello,

If you mean that you want to draw a string on the scanned image and save it, you can do this by handling the TwainSession.AcquirePage Event.
The event handler receives an argument of type TwainAcquirePageEventArgs. The TwainAcquirePageEventArgs have two properties:
- Cancel: Set to true to abort the acquire operation.  
- Image: Gets the IRasterImage which holds the image data acquired from the TWAIN Data Source.  

You can draw a string directly on the scanned image (TwainAcquirePageEventArgs.Image) by using the following code:
+---------------+
Private Sub twainSession_AcquirePage(ByVal sender As Object, ByVal e As TwainAcquirePageEventArgs) Handles twnSession.AcquirePage

Dim G As Graphics
Dim codecs As RasterCodecs

RasterCodecs.CodecsPath = "D:\Program Files\LEAD Technologies, Inc\LEADTOOLS 14.5\Redist\Dotnet\v11"

codecs = New RasterCodecs

RasterImageViewer1.Image = e.Image

G = e.Image.CreateGdiPlusGraphics().Graphics

G.DrawString("LEADTOOLS", New Font("Arial", 40), New SolidBrush(Color.Black), 100, 100)

codecs.Save(e.Image, "c:\Test_Scan.tif", RasterImageFormat.Tif, e.Image.BitsPerPixel, 1, 1, 1, CodecsSavePageMode.Append)

End Sub
+---------------+

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2020, Yet Another Forum.NET
This page was generated in 0.220 seconds.