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 : Thursday, March 19, 2020 3:33:03 PM(UTC)
Pawel L.

Groups: Registered, Manager, Tech Support, Administrators
Posts: 14


When initially trying to load in a Text File from memory stream as a Raster Image, the default options for RasterCodecs disable the loading of the text file.

Code:

         MemoryStream ms = new MemoryStream(File.ReadAllBytes(@"C:/temp/test.txt"));

         RasterCodecs rasterCodecs = new RasterCodecs();

         //Here we set this option to true, so that the Codecs is able to load in the txt file as a RasterImage from the memory stream
         rasterCodecs.Options.Txt.Load.Enabled = true;
         try
         {
            RasterImage image = rasterCodecs.Load(ms, 1);

            Console.WriteLine("loaded");
          
            Console.ReadLine();
         }
         catch (Exception ex) {
            Console.WriteLine("Exception: " + ex.Message);
            Console.WriteLine("Inner Exception " + ex.InnerException.Message);
         }


By setting rasterCodecs.Options.Txt.Load.Enabled = true, we are able to get around this default behavior.
Pawel Lyko
Developer Support Engineer
LEAD Technologies, Inc.

 

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.

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