Page 1 of 1

adding memory stream to ImageCollection results in license exception

Posted: Fri Jul 21, 2017 10:18 pm
by justinthompson

Code: Select all

...
using Vintasoft.Imaging;
using Vintasoft.Imaging.Annotation;
using Vintasoft.Imaging.Codecs.Encoders;
...

              
ImageCollection images = new ImageCollection();
images.Add(new MemoryStream(document.imagedata);
where imagedata is a byte array, I receive the following exception:

Code: Select all

System.ComponentModel.LicenseException: A valid license cannot be granted for the type Vintasoft.Imaging.Codecs.Decoders.DecoderBase. Contact the * of the component for more information.
   at Vintasoft.Imaging.VintasoftLicenseProvider.GetLicense(LicenseContext context, Type type, Object instance, Boolean allowExceptions)
   at System.ComponentModel.LicenseManager.ValidateInternalRecursive(LicenseContext context, Type type, Object instance, Boolean allowExceptions, License& license, String& licenseKey)
   at System.ComponentModel.LicenseManager.ValidateInternalRecursive(LicenseContext context, Type type, Object instance, Boolean allowExceptions, License& license, String& licenseKey)
   at System.ComponentModel.LicenseManager.Validate(Type type)
   at Vintasoft.Imaging.Codecs.Decoders.DecoderBase..ctor(Stream )
   at Vintasoft.Imaging.Codecs.Decoders.TiffDecoder..ctor(Stream stream)
   at .5.CreateDecoder(Stream stream)
   at Vintasoft.Imaging.Codecs.AvailableCodecs.(Stream )
   at .43.(Stream , Boolean , Boolean )
   at .46.(Stream , Boolean , String )
   at .46..ctor(Stream , Boolean )
   at Vintasoft.Imaging.ImageCollection.Insert(Int32 index, Stream stream, Boolean closeStreamAfterUse)
   at Vintasoft.Imaging.ImageCollection.Add(Stream stream, Boolean closeStreamAfterUse)
I am referencing Vintasoft.Imaging and Vintasoft.Imaging.Annotation in the solution. quick overview: What I'm trying to do here I'm already doing in a different form of the same solution with the same using statements.

The license is valid and functions in a different form of the same solution. I ran into this problem earlier but got around it by moving code around (something to do with the TiffEncoder class, I can't remember what I did with it). The lcx is referencing

Code: Select all

Vintasoft.Imaging.Annotation.UI.AnnotationViewer, Vintasoft.Imaging.Annotation, Version=8.3.15.1, Culture=neutral
with a public key token as well.

I've tried adding an empty byte[], I've also tried passing a bool as a second arg to the ImageCollection.Add. It recognizes when the memorystream is empty.

What I'm ultimately trying to accomplish: Load an image with annotations, flattened as a memorystream. No writing to the file system. I've accomplished this elsewhere in the solution by loading the exact same data in the same fashion. I have no clue where to look from this point.

Re: adding memory stream to ImageCollection results in license exception

Posted: Mon Jul 24, 2017 4:45 pm
by justinthompson
Ended up calling the VintasoftImage object creation from a method in the functioning form. Something about creating the vintasoftimage object from a memory stream in this form did not like the licensing.