This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Wednesday, July 18, 2007 1:04:26 AM(UTC)
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);
#2
Posted
:
Wednesday, July 18, 2007 10:43:11 PM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
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.