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 : Tuesday, October 31, 2006 2:47:02 PM(UTC)

bjames  
bjames

Groups: Registered
Posts: 22


Hello all.

I have a .NET project in which I'm using your active X control (LEAD Main 14.0).

I'm using this because the code is being ported from vb 6.0 and much of the functionality has changed (rubberband, GDI+ now, etc). Until I can implement a solution in .NET with the RasterImageView, I'll be using this control. I've ported the code over and everything works. I'll now need to add OCR to my application. I plan to use the .NET OCR classes. I need to know how I can get an IRasterImage from a LEAD Main control 14.0 or any other ideas as far as methods to get the bitmap from a LEAD main control and into the OCR engine.

Here is some code that I've been trying.

Dim ReturnArray as Object
ReturnArray = LEADMain.SaveArray(10, 24, 0)

Dim MyArray() as Byte
MyArray = CType(ReturnArray, Byte())
MsgBox("The contents " & MyArray.Length)

Dim ms as MemoryStream = new MemoryStream(MyArray)

Dim returnImage as Image = Image.FromStream(ms)<--Invalid argument exception

LEADRaster.Image = returnImage


Any ideas??


Thanks in advance.

Bryan James
 

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, November 1, 2006 5:54:29 AM(UTC)

Amin  
Amin

Groups: Manager, Tech Support
Posts: 367

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

Bryan,
To convert the bitmap from the main OCX to our .NET toolkit, use the RasterImageConverter.FromLeadBitmap Method.

If the Main OCX is called LEADMain, the code will look like this:
IntPtr prtToBitmap = new IntPtr(LEADMain.Bitmap);
Leadtools.IRasterImage img = RasterImageConverter.FromLeadBitmap(prtToBitmap, "LTKRN14N.DLL");

Amin Dodin

Senior Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 
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-2024, Yet Another Forum.NET
This page was generated in 0.056 seconds.