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, December 5, 2006 5:31:09 AM(UTC)

rmsrad  
rmsrad

Groups: Registered
Posts: 15


I am using Lead tools eval version 15 and I am using .Net interface. I am getting Invalid file format error when I try to load the image using the code codecs.Load("c://sample1.cmp"). I checked the forum and there is solution for version 14.5 to set the path of the Library  "RasterCodecs.CodecsPath". I do not see "CodesPath" property in version 15.  Any idea what needs to be done?

 

 

 

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, December 6, 2006 3:17:31 AM(UTC)

eprim  
eprim

Groups: Registered
Posts: 4


You need to call
Leadtools.Codecs.RasterCodecs.Startup();
before
codecs = new Leadtools.Codecs.RasterCodecs();
then you can load image.
 
#3 Posted : Wednesday, December 6, 2006 8:35:13 AM(UTC)

YPM  
YPM

Groups: Registered
Posts: 2


Hello,

I have the same issue and did call .startup during formload, but still not helping.

Here are the codes....

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

' Initialize a new RasterCodecs object

RasterCodecs.Startup()

codecs = New RasterCodecs()

End Sub

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

' show the open file dialog

Dim dlg As New OpenFileDialog

dlg.Filter = "All Files|*.*"

If (dlg.ShowDialog(Me) = Windows.Forms.DialogResult.OK) Then

Try

' try to load the file

RasterSupport.Unlock(RasterSupportType.PdfRead, "PDF_READ_UNLOCK_CODE")

'Dim rasterCodecs As New Codecs.RasterCodecs

' Resulting image pixel depth.

codecs.Options.Pdf.Load.DisplayDepth = 24

codecs.Options.Pdf.Load.GraphicsAlpha = 4

'rasterCodecs.Options.Pdf.Load.Password = ""

' Type of font anti-aliasing to use.

codecs.Options.Pdf.Load.TextAlpha = 4

codecs.Options.Pdf.Load.UseLibFonts = True

' Horizontal,vertical display resolution in dots per inch.

codecs.Options.Pdf.Load.XResolution = 300

codecs.Options.Pdf.Load.YResolution = 300

Dim tempImage As RasterImage = codecs.Load(dlg.FileName)

' set the image into the viewer

RasterImageViewer1.Image = tempImage

Catch ex As Exception

MessageBox.Show(Me, ex.Message)

End Try

End If

End Sub

Private Sub Form1_FormClosing(ByVal sender As System.Object, ByVal e As FormClosingEventArgs) Handles MyBase.FormClosing

RasterCodecs.Shutdown()

End Sub

 
#4 Posted : Wednesday, December 6, 2006 8:47:47 AM(UTC)

YPM  
YPM

Groups: Registered
Posts: 2


Got it!  added the Leadtools.Codecs.Pdf.dll to my reference helps!

 
#5 Posted : Wednesday, December 6, 2006 10:12:29 AM(UTC)

Amin  
Amin

Groups: Manager, Tech Support
Posts: 367

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

In most cases, the reason for this error is the absence of LEADTOOLS codec DLL files, such as "Leadtools.Codecs.Cmp.dll" needed for CMP and JPEG files.
The needed codecs must be in the application path or in the Global Assembly Cache (GAC). Adding them to the references ensures they're copied to the EXE's folder.

To know which codecs you need, see the help topic "Files to be Included with Your Application"

Amin Dodin

Senior Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 
#6 Posted : Thursday, December 7, 2006 10:23:19 AM(UTC)

rmsrad  
rmsrad

Groups: Registered
Posts: 15


I added the references  Leadtools.codec.XXX.dll and it solved the problem.

 

 
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.086 seconds.