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, August 11, 2010 9:41:09 PM(UTC)

danc  
danc

Groups: Registered
Posts: 7


The following code fragment works fine in one VB.NET 3.5 project but fails in another:<br />
<br />
Leadtools.RasterSupport.Unlock(Leadtools.RasterSupportType.J2k, xxx)<br />
Leadtools.RasterSupport.Unlock(Leadtools.RasterSupportType.Pro, yyy)<br />
Leadtools.Codecs.RasterCodecs.Startup()<br />
Leadtools.Codecs.RasterCodecs Codecs = New Leadtools.Codecs.RasterCodecs<br />
<br />
Dim hPic As System.IntPtr = My.Resources.VideoError.GetHbitmap()<br />
Dim ltRaster As Leadtools.RasterImage ltRaster = Leadtools.RasterImage.FromHBitmap(hPic, 0)<br />
<br />
DeleteObject(hPic)<br />
<br />
Dim memStream As IO.MemoryStream = New IO.MemoryStream<br />
Dim imageData As Byte()<br />
<br />
Codecs.Options.Jpeg.Save.QualityFactor = 150<br />
Codecs.Save(ltRaster, memStream, RasterImageFormat.Jpeg, 24)<br />
<br />
The Save operation throws this exception:<br />
<br />
A first chance exception of type 'Leadtools.RasterException' occurred in Leadtools.dll<br />
Leadtools.RasterException: Feature not supported<br />
at Leadtools.RasterException.CheckErrorCode(Int32 code)<br />
at Leadtools.Codecs.RasterCodecs.SaveOnePage(Int32 page, SaveParams saveParams)<br />
at Leadtools.Codecs.RasterCodecs.DoSave(SaveParams saveParams)<br />
at Leadtools.Codecs.RasterCodecs.Save(RasterImage image, Stream stream, RasterImageFormat format, Int32 bitsPerPixel)<br />
<br />
I am using the same Unlock codes and I have the following dlls in the bin directory:<br />
<br />
AxInterop.LTMMLib.dll (I think these are Leadtools)<br />
Interop.LTMMLib.dll (I think these are Leadtools)<br />
Leadtools.Codecs.Cmp.dll (version 15.0.1.0)<br />
Leadtools.Codecs.dll (version 15.0.1.8)<br />
Leadtools.Codecs.J2K.dll (version 15.0.1.0)<br />
Leadtools.ColorConversion.dll (version 15.0.1.1)<br />
Leadtools.dll (version 15.0.1.0)<br />
<br />
Any idea why this is failing? I have tried other file formats and same issue.<br />
<br />
Thanks in advance,<br />
<br />
Dan<br />
 

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, August 11, 2010 9:43:08 PM(UTC)

danc  
danc

Groups: Registered
Posts: 7


Looks like the formatting between the preview and the post don't match. Here is the same without the line breaks...


The following code fragment works fine in one VB.NET 3.5 project but fails in another:

Leadtools.RasterSupport.Unlock(Leadtools.RasterSupportType.J2k, xxx)
Leadtools.RasterSupport.Unlock(Leadtools.RasterSupportType.Pro, yyy)
Leadtools.Codecs.RasterCodecs.Startup()
Leadtools.Codecs.RasterCodecs Codecs = New Leadtools.Codecs.RasterCodecs

Dim hPic As System.IntPtr = My.Resources.VideoError.GetHbitmap()
Dim ltRaster As Leadtools.RasterImage ltRaster = Leadtools.RasterImage.FromHBitmap(hPic, 0)

DeleteObject(hPic)

Dim memStream As IO.MemoryStream = New IO.MemoryStream
Dim imageData As Byte()

Codecs.Options.Jpeg.Save.QualityFactor = 150
Codecs.Save(ltRaster, memStream, RasterImageFormat.Jpeg, 24)

The Save operation throws this exception:

A first chance exception of type 'Leadtools.RasterException' occurred in Leadtools.dll
Leadtools.RasterException: Feature not supported
at Leadtools.RasterException.CheckErrorCode(Int32 code)
at Leadtools.Codecs.RasterCodecs.SaveOnePage(Int32 page, SaveParams saveParams)
at Leadtools.Codecs.RasterCodecs.DoSave(SaveParams saveParams)
at Leadtools.Codecs.RasterCodecs.Save(RasterImage image, Stream stream, RasterImageFormat format, Int32 bitsPerPixel)

I am using the same Unlock codes and I have the following dlls in the bin directory:

AxInterop.LTMMLib.dll (I think these are Leadtools)
Interop.LTMMLib.dll (I think these are Leadtools)
Leadtools.Codecs.Cmp.dll (version 15.0.1.0)
Leadtools.Codecs.dll (version 15.0.1.8)
Leadtools.Codecs.J2K.dll (version 15.0.1.0)
Leadtools.ColorConversion.dll (version 15.0.1.1)
Leadtools.dll (version 15.0.1.0)

Any idea why this is failing? I have tried other file formats and same issue.

Thanks in advance,

Dan
 
#3 Posted : Thursday, August 12, 2010 1:40:20 AM(UTC)

Basel  
Guest

Groups: Guests
Posts: 3,028

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

Dan,

"Feature not supported" error message usually means that you are missing a required DLL to save the image. In your case, you are saving as JPEG, which means you will need to include Leadtools.Codecs.CMP.DLL, and it seems you are doing it.

Are these two projects on the same machines or two different machines?

In any case, you are running an old build of LEADTOOLS, please send your serial number (do NOT post it here) to support@leadtools.com and mention this forum post to give he latest patch files.

 
#4 Posted : Thursday, August 12, 2010 8:35:17 AM(UTC)

danc  
danc

Groups: Registered
Posts: 7


Thanks for you quick response.

Yes, both projects are on the same machine in two different folders. Both projects have the same properties (new project does not have the "Make assembly COM-visible" enabled) and both have the same DLLs (in fact I copied all the dlls from the other projects to the new project).

I will have my manager to send the serial number to you.

This is a critical issue since I need to deliver a working app this afternoon and this is a blocker.
 
#5 Posted : Saturday, August 14, 2010 11:24:41 PM(UTC)

Basel  
Guest

Groups: Guests
Posts: 3,028

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

We received your email to support@leadtools.com and the ticket number 2010081210000756 was generated. We will continue discussing this issue via email.
 
#6 Posted : Monday, August 16, 2010 8:38:17 PM(UTC)

danc  
danc

Groups: Registered
Posts: 7


Thanks you for your looking into this. It looks like I may have figured out the cause.

It appears that somehow I had missed AxInterop.LTMMLib.dll and Interop.LTMMLib.dll from actually getting copied in the bin folder (I thought it was there but I must have looked in the wrong place)! When I recopied them into the bin folder the save() function no longer threw an exception.
 
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.202 seconds.